diff options
Diffstat (limited to 'vue.config.js')
-rw-r--r-- | vue.config.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/vue.config.js b/vue.config.js index 12a723d6..882944fa 100644 --- a/vue.config.js +++ b/vue.config.js @@ -26,6 +26,8 @@ module.exports = { }, productionSourceMap: false, configureWebpack: config => { + const envName = process.env.VUE_APP_ENV_NAME; + if (process.env.NODE_ENV === 'production') { config.plugins.push( new CompressionPlugin({ @@ -33,6 +35,12 @@ module.exports = { }) ); } + if (envName !== undefined) { + // Resolve store and router modules in src/main.js + // depending on environment (VUE_APP_ENV_NAME) variable + config.resolve.alias['./store$'] = `./env/store/${envName}.js`; + config.resolve.alias['./router$'] = `./env/router/${envName}.js`; + } }, chainWebpack: config => { if (process.env.NODE_ENV === 'production') { |