-
Notifications
You must be signed in to change notification settings - Fork 1
/
svgo.config.js
49 lines (46 loc) · 1.96 KB
/
svgo.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// This is a customised list of options to support when running `svgo` commands within the project - see docs/front-end/tooling.md for examples of commands you can run.
// The full list of options and explanations can be found at https://github.com/svg/svgo#built-in-plugins
// Commented out rules are in the default config but deliberately disabled in ours
module.exports = {
js2svg: { useShortTags: false }, // add closing tags for ie11
plugins: [
'removeDoctype',
'removeXMLProcInst',
'removeComments',
'removeMetadata',
'removeEditorsNSData',
'cleanupAttrs',
'mergeStyles',
'inlineStyles',
'minifyStyles',
// 'cleanupIDs', // Disabled so we can run svgo with the sprites.html file
'removeUselessDefs',
'cleanupNumericValues',
'convertColors',
'removeUnknownsAndDefaults',
'removeNonInheritableGroupAttrs',
'removeUselessStrokeAndFill',
// 'removeViewBox', // We like view boxes thank you
'cleanupEnableBackground',
// 'removeHiddenElems', // Disabled so we can run svgo with the sprites.html file
'removeEmptyText',
'convertShapeToPath',
'convertEllipseToCircle',
'moveElemsAttrsToGroup',
'moveGroupAttrsToElems',
'collapseGroups',
'convertPathData',
'convertTransform',
'removeEmptyAttrs',
'removeEmptyContainers',
'mergePaths',
'removeUnusedNS',
'sortDefsChildren',
'removeTitle',
'removeDesc',
// The following extra rules enabled for our config but which are not in the default config
'removeXMLNS', // xmlns definition is not needed for inline sprites or background images
'removeDimensions', // convert width and height attributes to a viewBox attribute
'removeRasterImages', // added because if you have an embedded png you should probably just save the file as a png
],
};