Skip to content

Commit

Permalink
chore: optimize svg
Browse files Browse the repository at this point in the history
  • Loading branch information
lightbringer1991 committed Jul 23, 2019
1 parent aa16d7e commit bc9227c
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 108 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ before_script:
script:
- npm -v
- commitlint-travis
- npm run svgo
- git diff --exit-code
- "! grep -R --exclude-dir='*/node_modules/*' --include=package-lock.json 'http:' ."
- npm test
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ npm run test [-- --no-coverage]
# Run tests and rebuild on file changes.

npm run test:watch [--file=<path>] [--coverage]

# Optimize SVG before you commit
npm run svgo
```

Generating New Components
Expand Down
35 changes: 17 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"lint:prettier": "prettier-check '{src,www,config}/**/*.{js,json,jsx}'",
"lint": "npm run lint:eslint && npm run lint:sass && npm run lint:prettier",
"prettier": "prettier \"{src,www,config}/**/*.{js,json,jsx}\" --write",
"svgo": "svgo --recursive --multipass --folder=src --config=svgo-config.yml",
"posttest": "npm run lint",
"postversion": "git push -u origin $(git rev-parse --abbrev-ref HEAD) --follow-tags && npm publish && echo '…released.'",
"preversion": "echo 'Releasing…' && npm i",
Expand Down Expand Up @@ -145,6 +146,7 @@
"sinon": "^4.2.2",
"style-loader": "^0.23.1",
"svg4everybody": "^2.1.9",
"svgo": "^1.3.0",
"terser-webpack-plugin": "^1.3.0",
"url-loader": "^0.6.2",
"url-search-params-polyfill": "^6.0.0",
Expand Down
40 changes: 1 addition & 39 deletions src/styles/icons/burger.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/styles/icons/checkbox/partial.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/styles/icons/close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 1 addition & 43 deletions src/styles/icons/details.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions src/styles/icons/search/search-gray.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions src/styles/icons/search/search-primary.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions svgo-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
plugins:
- convertStyleToAttrs: true
- removeAttrs:
attrs: 'id'
- inlineStyles:
onlyMatchedOnce: false

0 comments on commit bc9227c

Please sign in to comment.