2023-10-25 16:51:08 +08:00
|
|
|
/**
|
|
|
|
* 配置参考: https://cli.vuejs.org/zh/config/
|
|
|
|
*/
|
2023-09-26 13:48:56 +08:00
|
|
|
const path = require('path')
|
|
|
|
function resolve(dir) {
|
|
|
|
return path.join(__dirname, dir)
|
|
|
|
}
|
|
|
|
module.exports = {
|
2023-10-25 16:51:08 +08:00
|
|
|
publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
|
|
|
|
chainWebpack: (config) => {
|
|
|
|
config.module.rule('svg').exclude.add(resolve('src/icons')).end()
|
2023-09-26 13:48:56 +08:00
|
|
|
|
|
|
|
config.module
|
|
|
|
.rule('icons')
|
|
|
|
.test(/\.svg$/)
|
2023-10-25 16:51:08 +08:00
|
|
|
.include.add(resolve('src/icons'))
|
2023-09-26 13:48:56 +08:00
|
|
|
.end()
|
|
|
|
.use('svg-sprite-loader')
|
|
|
|
.loader('svg-sprite-loader')
|
2023-10-25 16:51:08 +08:00
|
|
|
},
|
|
|
|
productionSourceMap: false,
|
|
|
|
devServer: {
|
|
|
|
open: true,
|
|
|
|
port: 8001,
|
|
|
|
overlay: {
|
|
|
|
errors: true,
|
|
|
|
warnings: true
|
|
|
|
}
|
2023-09-26 13:48:56 +08:00
|
|
|
}
|
|
|
|
}
|