Skip to content

Commit

Permalink
Use svgo to format svg files
Browse files Browse the repository at this point in the history
  • Loading branch information
lipis committed Sep 21, 2018
1 parent f514b44 commit 15688fc
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 2 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"prettier": "^1.12",
"prettier-eslint-cli": "4.7.1",
"rimraf": "^2.6.1",
"svgo": "^1.1.1",
"yaml-lint": "^1.2.4",
"yargs": "^10.0.3"
},
Expand All @@ -57,6 +58,7 @@
"format-scripts": "prettier-eslint --write \"scripts/**/*.js\"",
"format-www": "prettier-eslint --write \"www/*.js\" \"www/src/**/*.js\"",
"format-integration": "prettier-eslint --write \"integration-tests/**/src/**/*.js\" \"integration-tests/**/cypress/**/*.js\"",
"format-svg": "find static | grep '\\.svg$' | xargs -Iz -n 1 svgo --pretty --indent=2 --config=svgo.yml z",
"jest": "jest",
"lerna": "lerna",
"lerna-prepare": "lerna run prepare",
Expand Down
8 changes: 8 additions & 0 deletions svgo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
plugins:
- collapseGroups: true
- removeDesc: true
- removeScriptElement: true
- removeStyleElement: true
- removeTitle: true
- removeUselessDefs: true
- removeViewBox: false
39 changes: 37 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4978,6 +4978,15 @@ css-select@^1.1.0, css-select@~1.2.0:
domutils "1.5.1"
nth-check "~1.0.1"

css-select@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/css-select/-/css-select-2.0.0.tgz#7aa2921392114831f68db175c0b6a555df74bbd5"
dependencies:
boolbase "^1.0.0"
css-what "2.1"
domutils "^1.7.0"
nth-check "^1.0.1"

css-select@~1.3.0-rc0:
version "1.3.0-rc0"
resolved "https://registry.yarnpkg.com/css-select/-/css-select-1.3.0-rc0.tgz#6f93196aaae737666ea1036a8cb14a8fcb7a9231"
Expand All @@ -4999,6 +5008,13 @@ css-selector-tokenizer@^0.7.0:
fastparse "^1.1.1"
regexpu-core "^1.0.0"

[email protected]:
version "1.0.0-alpha.28"
resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-1.0.0-alpha.28.tgz#8e8968190d886c9477bc8d61e96f61af3f7ffa7f"
dependencies:
mdn-data "~1.1.0"
source-map "^0.5.3"

[email protected]:
version "1.0.0-alpha.29"
resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-1.0.0-alpha.29.tgz#3fa9d4ef3142cbd1c301e7664c1f352bd82f5a39"
Expand Down Expand Up @@ -5821,7 +5837,7 @@ [email protected]:
dom-serializer "0"
domelementtype "1"

domutils@^1.5.1:
domutils@^1.5.1, domutils@^1.7.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a"
dependencies:
Expand Down Expand Up @@ -9694,7 +9710,7 @@ [email protected]:
argparse "^1.0.7"
esprima "^4.0.0"

js-yaml@^3.10.0, js-yaml@^3.11.0, js-yaml@^3.5.2, js-yaml@^3.7.0, js-yaml@^3.9.0, js-yaml@^3.9.1:
js-yaml@^3.10.0, js-yaml@^3.11.0, js-yaml@^3.12.0, js-yaml@^3.5.2, js-yaml@^3.7.0, js-yaml@^3.9.0, js-yaml@^3.9.1:
version "3.12.0"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1"
dependencies:
Expand Down Expand Up @@ -15502,6 +15518,25 @@ svgo@^1.0.0:
unquote "~1.1.1"
util.promisify "~1.0.0"

svgo@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/svgo/-/svgo-1.1.1.tgz#12384b03335bcecd85cfa5f4e3375fed671cb985"
dependencies:
coa "~2.0.1"
colors "~1.1.2"
css-select "^2.0.0"
css-select-base-adapter "~0.1.0"
css-tree "1.0.0-alpha.28"
css-url-regex "^1.1.0"
csso "^3.5.0"
js-yaml "^3.12.0"
mkdirp "~0.5.1"
object.values "^1.0.4"
sax "~1.2.4"
stable "~0.1.6"
unquote "~1.1.1"
util.promisify "~1.0.0"

sw-precache@^5.2.0:
version "5.2.1"
resolved "https://registry.yarnpkg.com/sw-precache/-/sw-precache-5.2.1.tgz#06134f319eec68f3b9583ce9a7036b1c119f7179"
Expand Down

0 comments on commit 15688fc

Please sign in to comment.