47 lines
952 B
JavaScript
47 lines
952 B
JavaScript
|
const path = require('path')
|
||
|
function resolve (dir) {
|
||
|
return path.join(__dirname, dir)
|
||
|
}
|
||
|
module.exports = {
|
||
|
lintOnSave: false,
|
||
|
devServer: {
|
||
|
open: true,
|
||
|
openPage: '',
|
||
|
host: '0.0.0.0',
|
||
|
port: 8080,
|
||
|
https: false,
|
||
|
proxy: null, // 设置代理
|
||
|
before: app => {}
|
||
|
},
|
||
|
css: {
|
||
|
loaderOptions: {
|
||
|
sass: {
|
||
|
// 添加这个配置来支持 @import
|
||
|
sassOptions: {
|
||
|
quietDeps: true
|
||
|
},
|
||
|
// 使用新的 API
|
||
|
implementation: require('sass')
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
chainWebpack: config => {
|
||
|
config.resolve.alias
|
||
|
.set('@', resolve('src'))
|
||
|
.set('@a', resolve('src/assets'))
|
||
|
.set('@c', resolve('src/components'))
|
||
|
// 优化大文件处理
|
||
|
config.performance
|
||
|
.maxEntrypointSize(1024000)
|
||
|
.maxAssetSize(1024000)
|
||
|
},
|
||
|
configureWebpack: {
|
||
|
optimization: {
|
||
|
splitChunks: {
|
||
|
chunks: 'all',
|
||
|
maxSize: 250000
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|