Skip to content

Commit 3693cb8

Browse files
committed
Fix SVGO configuration
- Simplified SVGO configuration by using 'preset-default' and enabling specific plugins. - Updated Webpack configuration to reference the new SVGO config format. - Removed the outdated default.jpg image and added a new default.webp image for better optimization.
1 parent 9fbaf3c commit 3693cb8

4 files changed

Lines changed: 15 additions & 36 deletions

File tree

‎config/svgo.config.js‎

Lines changed: 14 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,17 @@
11
module.exports = {
22
plugins: [
3-
{ cleanupAttrs: true },
4-
{ removeDoctype: true },
5-
{ removeXMLProcInst: true },
6-
{ removeComments: true },
7-
{ removeMetadata: true },
8-
{ removeTitle: true },
9-
{ removeDesc: true },
10-
{ removeUselessDefs: true },
11-
{ removeEditorsNSData: true },
12-
{ removeEmptyAttrs: true },
13-
{ removeHiddenElems: true },
14-
{ removeEmptyText: true },
15-
{ removeEmptyContainers: true },
16-
{ cleanupEnableBackground: true },
17-
{ convertStyleToAttrs: true },
18-
{ convertColors: true },
19-
{ convertPathData: true },
20-
{ convertTransform: true },
21-
{ removeUnknownsAndDefaults: true },
22-
{ removeNonInheritableGroupAttrs: true },
23-
{ removeUselessStrokeAndFill: true },
24-
{ removeUnusedNS: true },
25-
{ cleanupIDs: true },
26-
{ cleanupNumericValues: true },
27-
{ moveElemsAttrsToGroup: true },
28-
{ moveGroupAttrsToElems: true },
29-
{ collapseGroups: true },
30-
{ removeRasterImages: false },
31-
{ mergePaths: true },
32-
{ convertShapeToPath: true },
33-
{ sortAttrs: true },
34-
{ removeDimensions: false },
35-
{ prefixIds: true },
36-
{ removeViewBox: false },
3+
{
4+
name: 'preset-default',
5+
params: {
6+
overrides: {
7+
// Disable a plugin included by default that you don't want (false)
8+
removeViewBox: false,
9+
},
10+
},
11+
},
12+
// Plugins that are not in the "preset-default" and that you want to activate
13+
'removeTitle',
14+
'convertStyleToAttrs',
15+
'prefixIds',
3716
],
38-
};
17+
}

‎config/webpack.common.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module.exports = {
2525
['jpegtran', { progressive: true }],
2626
['optipng', { optimizationLevel: 5 }],
2727
// Svgo configuration here https://github.com/svg/svgo#configuratio
28-
['svgo', { svgoconfig }],
28+
['svgo', svgoconfig],
2929
],
3030
},
3131
},

‎src/img/static/default.jpg‎

-6.58 KB
Binary file not shown.

‎src/img/static/default.webp‎

3.84 KB
Loading

0 commit comments

Comments
 (0)