You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
529 B
23 lines
529 B
const path = require('path')
|
|
|
|
function resolve(dir) {
|
|
return path.join(__dirname, '.', dir)
|
|
}
|
|
|
|
module.exports = {
|
|
lintOnSave: false,
|
|
chainWebpack: config => {
|
|
config.module.rules.delete("svg"); //重点:删除默认配置中处理svg,
|
|
config.module
|
|
.rule('svg-sprite-loader')
|
|
.test(/\.svg$/)
|
|
.include
|
|
.add(resolve('src/icons')) //处理svg目录
|
|
.end()
|
|
.use('svg-sprite-loader')
|
|
.loader('svg-sprite-loader')
|
|
.options({
|
|
symbolId: 'icon-[name]'
|
|
})
|
|
},
|
|
}; |