提交 4e5ffe01 作者: 毛细亚

修改部署路径配置

上级 ef9aa8ce
# just a flag # just a flag
NODE_ENV = 'staging' NODE_ENV = 'staging'
ENV = 'staging' ENV = 'staging'
......
...@@ -20,7 +20,8 @@ function resolve(dir) { ...@@ -20,7 +20,8 @@ function resolve(dir) {
return path.join(__dirname, dir) return path.join(__dirname, dir)
} }
module.exports = defineConfig({ module.exports = defineConfig({
publicPath: './', // 非 dev 与 router base `/company_app` 对齐;prod 会提取 CSS,相对 publicPath 易导致 @font-face 路径在正式环境解析错误(Element 图标空白)
publicPath: process.env.NODE_ENV === 'development' ? '/' : '/company_app/',
assetsDir: 'static', assetsDir: 'static',
transpileDependencies: true, transpileDependencies: true,
outputDir: 'company_app', outputDir: 'company_app',
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论