diff --git a/sapl-frontend/package.json b/sapl-frontend/package.json index 617aa9735..e2d9fa5a9 100644 --- a/sapl-frontend/package.json +++ b/sapl-frontend/package.json @@ -8,9 +8,11 @@ "lint": "vue-cli-service lint" }, "dependencies": { + "dotenv": "^6.2.0", "vue": "^2.5.21", "vue-router": "^3.0.1", "vuex": "^3.0.1", + "webpack": "^4.28.4", "webpack-bundle-tracker": "^0.4.2-beta" }, "devDependencies": { diff --git a/sapl-frontend/src/hellow/router.js b/sapl-frontend/src/hellow/router.js index 312079b94..613500153 100644 --- a/sapl-frontend/src/hellow/router.js +++ b/sapl-frontend/src/hellow/router.js @@ -6,6 +6,5 @@ Vue.use(Router); export default new Router({ mode: "history", base: process.env.BASE_URL, - routes: [ - ] + routes: [] }); diff --git a/sapl-frontend/vue.config.js b/sapl-frontend/vue.config.js index 9747e93b9..996418949 100644 --- a/sapl-frontend/vue.config.js +++ b/sapl-frontend/vue.config.js @@ -1,4 +1,8 @@ +const webpack = require('webpack') + const BundleTracker = require('webpack-bundle-tracker') +const dotenv = require('dotenv') +dotenv.config({ path: '../sapl/.env' }) module.exports = { publicPath: 'http://localhost:8080/', @@ -32,10 +36,16 @@ module.exports = { .add('./src/hellow/main.js') .end() - // then add your own config.entry('theme') .add('./src/theme/main.js') .end() + config + .plugin('theme') + .use(webpack.DefinePlugin, [{ + THEME_CUSTOM: JSON.stringify(process.env.THEME_CUSTOM) + }]) + .end() + } }