fix bugs
This commit is contained in:
@@ -5,12 +5,26 @@ module.exports = {
|
||||
// 静态资源目录
|
||||
assetsDir: 'static',
|
||||
|
||||
// 公共路径 - 重要!确保静态资源能正确加载
|
||||
publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
|
||||
|
||||
// 生产环境配置
|
||||
productionSourceMap: false,
|
||||
|
||||
// CSS 提取配置
|
||||
css: {
|
||||
extract: true
|
||||
extract: true,
|
||||
sourceMap: false
|
||||
},
|
||||
|
||||
// 开发服务器配置
|
||||
devServer: {
|
||||
port: 8080,
|
||||
open: true,
|
||||
overlay: {
|
||||
warnings: false,
|
||||
errors: true
|
||||
}
|
||||
},
|
||||
|
||||
chainWebpack: config => {
|
||||
@@ -18,5 +32,13 @@ module.exports = {
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
config.performance.hints(false)
|
||||
}
|
||||
|
||||
// 确保 CSS 文件正确处理
|
||||
config.module
|
||||
.rule('vue')
|
||||
.use('vue-loader')
|
||||
.tap(options => {
|
||||
return options
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user