This commit is contained in:
2025-12-17 09:23:27 +08:00
parent eaac987a5c
commit 6f3b8db273
3 changed files with 452 additions and 1 deletions

View File

@@ -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
})
}
}