summaryrefslogtreecommitdiff
path: root/vue.config.js
diff options
context:
space:
mode:
authorAndrey V.Kosteltsev <AKosteltsev@IBS.RU>2022-07-04 12:02:15 +0300
committerAndrey V.Kosteltsev <AKosteltsev@IBS.RU>2022-07-04 16:37:05 +0300
commitecb251fa0a2a790bac137837a49a9fcba997abfb (patch)
treeb884a22cb5c6ed3ff3c4f5135305057a83e83f3d /vue.config.js
parentec06fd210a1f1e8beab136b7b40154df540e73a8 (diff)
downloadwebui-vue-ecb251fa0a2a790bac137837a49a9fcba997abfb.tar.xz
Enable alternative styles according to VUE_APP_ENV_NAME
Signed-off-by: Andrey V.Kosteltsev <AKosteltsev@IBS.RU>
Diffstat (limited to 'vue.config.js')
-rw-r--r--vue.config.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/vue.config.js b/vue.config.js
index de0ad12a..ff2de366 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -1,5 +1,7 @@
const CompressionPlugin = require('compression-webpack-plugin');
+const Fs = require('fs');
+
module.exports = {
css: {
loaderOptions: {
@@ -8,16 +10,22 @@ module.exports = {
const envName = process.env.VUE_APP_ENV_NAME;
const hasCustomStyles =
process.env.CUSTOM_STYLES === 'true' ? true : false;
+ var themeName;
if (hasCustomStyles && envName !== undefined) {
// If there is an env name defined, import Sass
// overrides.
// It is important that these imports stay in this
// order to make sure enviroment overrides
// take precedence over the default BMC styles
+ themeName = envName;
+ if( ! Fs.existsSync('./src/assets/styles/_obmc-' + envName + '.scss') ) {
+ themeName = "custom";
+ }
return `
@import "@/assets/styles/bmc/helpers";
@import "@/env/assets/styles/_${envName}";
@import "@/assets/styles/bootstrap/_helpers";
+ @import "@/assets/styles/_obmc-${themeName}";
`;
} else {
// Include helper imports so single file components
@@ -30,6 +38,7 @@ module.exports = {
return `
@import "@/assets/styles/bmc/helpers";
@import "@/assets/styles/bootstrap/_helpers";
+ @import "@/assets/styles/_obmc-custom";
`;
}
},