This commit is contained in:
jawn-ha 2021-04-20 05:11:49 +00:00 committed by GitHub
commit 35e2723dc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 24 deletions

View File

@ -10,7 +10,6 @@
"build:stage": "vue-cli-service build --mode staging",
"preview": "node build/index.js --preview",
"new": "plop",
"svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml",
"test:unit": "jest --clearCache && vue-cli-service test:unit",
"test:ci": "npm run lint && npm run test:unit"
},
@ -69,7 +68,8 @@
"script-ext-html-webpack-plugin": "2.1.3",
"serve-static": "1.13.2",
"svg-sprite-loader": "4.1.3",
"svgo": "1.2.0",
"svgo-loader": "^3.0.0",
"svgo": "^2.3.0",
"vue-template-compiler": "2.6.10"
},
"browserslist": [

View File

@ -1,22 +0,0 @@
# 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'

View File

@ -1,6 +1,7 @@
'use strict'
const path = require('path')
const defaultSettings = require('./src/settings.js')
const { extendDefaultPlugins } = require('svgo')
function resolve(dir) {
return path.join(__dirname, dir)
@ -80,6 +81,19 @@ module.exports = {
symbolId: 'icon-[name]'
})
.end()
.use('svgo-loader')
.loader('svgo-loader')
.options({
plugins: extendDefaultPlugins([
{
name: 'removeAttrs',
params: {
attrs: ['fill', 'fill-rule']
}
}
])
})
.end()
config
.when(process.env.NODE_ENV !== 'development',