zb-admin/vue.config.js

34 lines
742 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const path = require('path')
function resolve (dir) {
return path.join(__dirname, '.', dir)
}
module.exports = {
lintOnSave: false,
publicPath: './',
chainWebpack: config => {
config.resolve.alias
.set('static', resolve('public/static'))
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]'
})
},
css: {
loaderOptions: {
sass: {
prependData: `@import "~@/styles/index.scss";`
}
}
}
}