diff --git a/vue.config.js b/vue.config.js index 73f199c82..69f00e241 100644 --- a/vue.config.js +++ b/vue.config.js @@ -12,6 +12,13 @@ const webpack = require('webpack'); const name = defaultSettings.title; // page title const port = 9527; // dev port +let publicPath = ''; +let outputDir = ''; +(function () { + publicPath = process.env.VUE_APP_PRO == 'local' ? '/' : '/cbtc'; + outputDir = process.env.VUE_APP_PRO == 'local' ? 'dist' : 'dist/cbtc'; +})(); + // All configuration item explanations can be find in https://cli.vuejs.org/config/ module.exports = { /** @@ -21,8 +28,8 @@ module.exports = { * In most cases please use '/' !!! * Detail: https://cli.vuejs.org/config/#publicpath */ - publicPath: '/cbtc', - outputDir: 'dist/cbtc', + publicPath: publicPath, + outputDir: outputDir, assetsDir: 'static', // 相对于outputDir的静态资源(js、css、img、fonts)目录 lintOnSave: false, productionSourceMap: false, // 项目打包后是否压缩