From 8df732281d595773a1ce534afd2a4c32e834d689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=B1=E8=A3=A4=E8=A1=A9?= Date: Mon, 17 Sep 2018 16:15:40 +0800 Subject: [PATCH] refactor svg (#181) --- package.json | 4 +++- src/icons/svg/example.svg | 2 +- src/icons/svg/eye.svg | 2 +- src/icons/svg/form.svg | 2 +- src/icons/svg/link.svg | 2 +- src/icons/svg/nested.svg | 2 +- src/icons/svg/password.svg | 2 +- src/icons/svg/table.svg | 2 +- src/icons/svg/tree.svg | 2 +- src/icons/svg/user.svg | 2 +- src/icons/svgo.yml | 22 ++++++++++++++++++++++ 11 files changed, 34 insertions(+), 10 deletions(-) create mode 100644 src/icons/svgo.yml diff --git a/package.json b/package.json index 161f23c..6375852 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ "build": "node build/build.js", "build:report": "npm_config_report=true npm run build", "lint": "eslint --ext .js,.vue src", - "test": "npm run lint" + "test": "npm run lint", + "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml" }, "dependencies": { "axios": "0.18.0", @@ -59,6 +60,7 @@ "semver": "5.5.0", "shelljs": "0.8.2", "svg-sprite-loader": "3.8.0", + "svgo": "1.0.5", "uglifyjs-webpack-plugin": "1.2.7", "url-loader": "1.0.1", "vue-loader": "15.3.0", diff --git a/src/icons/svg/example.svg b/src/icons/svg/example.svg index 19cd9ed..46f42b5 100644 --- a/src/icons/svg/example.svg +++ b/src/icons/svg/example.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/eye.svg b/src/icons/svg/eye.svg index 194aa45..16ed2d8 100644 --- a/src/icons/svg/eye.svg +++ b/src/icons/svg/eye.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/form.svg b/src/icons/svg/form.svg index d848c8a..dcbaa18 100644 --- a/src/icons/svg/form.svg +++ b/src/icons/svg/form.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/link.svg b/src/icons/svg/link.svg index 11037e6..0709014 100644 --- a/src/icons/svg/link.svg +++ b/src/icons/svg/link.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/nested.svg b/src/icons/svg/nested.svg index f564197..06713a8 100644 --- a/src/icons/svg/nested.svg +++ b/src/icons/svg/nested.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/password.svg b/src/icons/svg/password.svg index 920b500..e291d85 100644 --- a/src/icons/svg/password.svg +++ b/src/icons/svg/password.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/table.svg b/src/icons/svg/table.svg index da6ffff..dbfe5d6 100644 --- a/src/icons/svg/table.svg +++ b/src/icons/svg/table.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/tree.svg b/src/icons/svg/tree.svg index 11cedc0..dd4b7dd 100644 --- a/src/icons/svg/tree.svg +++ b/src/icons/svg/tree.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/user.svg b/src/icons/svg/user.svg index 5971dee..0ba0716 100644 --- a/src/icons/svg/user.svg +++ b/src/icons/svg/user.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svgo.yml b/src/icons/svgo.yml new file mode 100644 index 0000000..d11906a --- /dev/null +++ b/src/icons/svgo.yml @@ -0,0 +1,22 @@ +# replace default config + +# multipass: true +# full: true + +plugins: + + # - name + # + # or: + # - name: false + # - name: true + # + # or: + # - name: + # param1: 1 + # param2: 2 + +- removeAttrs: + attrs: + - 'fill' + - 'fill-rule'