diff options
Diffstat (limited to 'vue.config.js')
-rw-r--r-- | vue.config.js | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/vue.config.js b/vue.config.js index 81763622..1e17def0 100644 --- a/vue.config.js +++ b/vue.config.js @@ -6,7 +6,9 @@ module.exports = { sass: { prependData: () => { const envName = process.env.VUE_APP_ENV_NAME; - if (envName !== undefined) { + const hasCustomStyles = + process.env.CUSTOM_STYLES === 'true' ? true : false; + if (hasCustomStyles && envName !== undefined) { // If there is an env name defined, import Sass // overrides. // It is important that these imports stay in this @@ -14,7 +16,7 @@ module.exports = { // take precedence over the default BMC styles return ` @import "@/assets/styles/bmc/helpers"; - @import "@/env/assets/styles/_${process.env.VUE_APP_ENV_NAME}"; + @import "@/env/assets/styles/_${envName}"; @import "@/assets/styles/bootstrap/_helpers"; `; } else { @@ -51,6 +53,8 @@ module.exports = { productionSourceMap: false, configureWebpack: config => { const envName = process.env.VUE_APP_ENV_NAME; + const hasCustomStore = process.env.CUSTOM_STORE === 'true' ? true : false; + const hasCustomRouter = process.env.CUSTOM_ROUTER === 'true' ? true : false; if (process.env.NODE_ENV === 'production') { config.plugins.push( @@ -59,11 +63,16 @@ 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`; + if (hasCustomStore) { + // If env has custom store, resolve store module in src/main.js + config.resolve.alias['./store$'] = `./env/store/${envName}.js`; + } + if (hasCustomRouter) { + // If env has custom router, resolve router module in src/main.js + config.resolve.alias['./router$'] = `./env/router/${envName}.js`; + } } }, chainWebpack: config => { |