svgo.yml 1.42 KB
Newer Older
XhmikosR's avatar
XhmikosR committed
1
2
3
4
5
6
7
8
# Usage:
# install svgo globally: `npm i -g svgo`
# svgo --config=build/svgo.yml --input=foo.svg

# https://github.com/svg/svgo/blob/master/docs/how-it-works/en.md
# replace default config

multipass: true
XhmikosR's avatar
XhmikosR committed
9
#full: true
XhmikosR's avatar
XhmikosR committed
10
11
12
13
14
15
16
17

# https://github.com/svg/svgo/blob/master/lib/svgo/js2svg.js#L6 for more config options

js2svg:
  pretty: true
  indent: 2

plugins:
XhmikosR's avatar
XhmikosR committed
18
19
20
#  - addAttributesToSVGElement:
#      attributes:
#        - focusable: false
XhmikosR's avatar
XhmikosR committed
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
  - cleanupAttrs: true
  - cleanupEnableBackground: true
  - cleanupIDs: true
  - cleanupListOfValues: true
  - cleanupNumericValues: true
  - collapseGroups: true
  - convertColors: true
  - convertPathData: true
  - convertShapeToPath: true
  - convertStyleToAttrs: true
  - convertTransform: true
  - inlineStyles: true
  - mergePaths: true
  - minifyStyles: true
  - moveElemsAttrsToGroup: true
  - moveGroupAttrsToElems: true
XhmikosR's avatar
XhmikosR committed
37
38
39
  - removeAttrs:
      attrs:
        - "data-name"
XhmikosR's avatar
XhmikosR committed
40
41
42
43
44
45
46
47
48
49
  - removeComments: true
  - removeDesc: true
  - removeDoctype: true
  - removeEditorsNSData: true
  - removeEmptyAttrs: true
  - removeEmptyContainers: true
  - removeEmptyText: true
  - removeHiddenElems: true
  - removeMetadata: true
  - removeNonInheritableGroupAttrs: true
50
51
52
  - removeTitle: false
  - removeUnknownsAndDefaults:
      keepRoleAttr: true
XhmikosR's avatar
XhmikosR committed
53
54
55
56
57
  - removeUnusedNS: true
  - removeUselessDefs: true
  - removeUselessStrokeAndFill: true
  - removeViewBox: false
  - removeXMLNS: false
XhmikosR's avatar
XhmikosR committed
58
  - removeXMLProcInst: true
XhmikosR's avatar
XhmikosR committed
59
  - sortAttrs: true