-
Notifications
You must be signed in to change notification settings - Fork 5
/
svgo.config.js
41 lines (40 loc) · 1.38 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
const SvgoCreateConfig = (config) => ({
js2svg: { pretty: !!config.pretty, eol: '\n', indent: 4 },
plugins: [
{
name: 'preset-default',
params: {
overrides: {
// customize options for plugins included in preset
convertColors: { shortname: false },
// or disable plugins
cleanupIds: false,
convertShapeToPath: false,
convertTransform: false,
removeViewBox: false,
removeUselessDefs: false,
removeHiddenElems: false,
mergePaths: false,
mergeStyles: false,
},
},
},
{
name: 'prefixIds',
params: {
delim: '-',
prefix: config.prefix ? config.prefix : false,
prefixIds: !!config.prefix,
prefixClassNames: false,
},
},
{ name: 'removeRasterImages' },
// configure builtin plugin not included in preset
{ name: 'noDataURL', ...require('./svgo.no-data-url') },
{ name: 'noSpriteURL', ...require('./svgo.no-sprite-url') },
],
floatPrecision: 6,
transformPrecision: 6,
multipass: true,
});
module.exports.SvgoCreateConfig = SvgoCreateConfig;