Skip to content

Commit

Permalink
optimize svg
Browse files Browse the repository at this point in the history
  • Loading branch information
mariotaku committed Jul 12, 2024
1 parent fbcc0a6 commit 09d582c
Showing 1 changed file with 23 additions and 10 deletions.
33 changes: 23 additions & 10 deletions webpack.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -185,16 +185,29 @@ export default function (env, argv) {
minimizer: [
'...',
new ImageMinimizerPlugin({
minimizer: {
implementation: ImageMinimizerPlugin.sharpMinify,
options: {
encodeOptions: {
jpeg: {quality: 90},
webp: {lossless: false},
avif: {lossless: false},
}
minimizer: [
{
implementation: ImageMinimizerPlugin.sharpMinify,
options: {
encodeOptions: {
jpeg: {},
webp: {},
avif: {},
}
},
},
},
{
// `svgo` will handle vector images (SVG)
implementation: ImageMinimizerPlugin.svgoMinify,
options: {
encodeOptions: {
multipass: true,
plugins: [
"preset-default",
],
},
},
}],
generator: [
{
preset: 'webp',
Expand All @@ -213,7 +226,7 @@ export default function (env, argv) {
avif: {lossless: false},
}
}
}
},
],
}),
new CssMinimizerPlugin(),
Expand Down

0 comments on commit 09d582c

Please sign in to comment.