forked from xpf0000/vuesvgicon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
33 lines (33 loc) · 930 Bytes
/
vue.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const path = require('path')
const webpack = require('webpack')
const resolve = (dir) => {
return path.join(__dirname, dir)
}
module.exports = {
configureWebpack: {
resolve: {
alias: {
'@': resolve('src')
}
},
output: {
libraryExport: 'default'
},
plugins: []
},
chainWebpack: config => {
config.module.rules.delete('svg') // 重点:删除默认配置中处理svg,
// const svgRule = config.module.rule('svg')
// svgRule.uses.clear()
config.module
.rule('svg-inline-loader')
.test(/\.svg$/)
.use('svg-inline-loader')
.loader('svg-inline-loader')
.options({
removeTags: true,
removingTags: ['p-id', 'id', 'class', 'title', 'desc', 'defs', 'style'],
removingTagAttrs: ['fill', 't', 'version', 'p-id', 'id', 'class', 'title', 'desc', 'defs', 'style', 'width', 'height', 'xmlns', 'xmlns:xlink']
})
}
}