From 8535730f943569598d9cf2eb593624d056039152 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Mon, 29 Mar 2021 19:08:30 +0200 Subject: [PATCH] make VUE_PATH as env-variable and use "/" as default if no .env exist --- frontend/.env.dist | 3 ++- frontend/vue.config.js | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/frontend/.env.dist b/frontend/.env.dist index bbd42d002..c8323c316 100644 --- a/frontend/.env.dist +++ b/frontend/.env.dist @@ -1,3 +1,4 @@ LOGIN_API_URL=http://localhost/login_api/ COMMUNITY_API_STATE_BALANCE_URL=http://localhost/state-balances/ -COMMUNITY_API_TRANSACTION_CREATION_URL=http://localhost/transaction-creations/ \ No newline at end of file +COMMUNITY_API_TRANSACTION_CREATION_URL=http://localhost/transaction-creations/ +VUE_PATH=/vue \ No newline at end of file diff --git a/frontend/vue.config.js b/frontend/vue.config.js index 5b031b7cf..f3a4094cb 100644 --- a/frontend/vue.config.js +++ b/frontend/vue.config.js @@ -4,6 +4,12 @@ const dotenv = require('dotenv-webpack') function resolveSrc(_path) { return path.join(__dirname, _path) } + +let vue_path = process.env.VUE_PATH +if(vue_path == undefined) { + vue_path = "" +} + // vue.config.js module.exports = { pluginOptions: { @@ -15,7 +21,7 @@ module.exports = { }, }, lintOnSave: true, - publicPath: '/vue/', + publicPath: vue_path + '/', configureWebpack: { // Set up all the aliases we use in our app. resolve: { @@ -29,5 +35,5 @@ module.exports = { // Enable CSS source maps. sourceMap: process.env.NODE_ENV !== 'production', }, - outputDir: path.resolve(__dirname, './dist/vue'), + outputDir: path.resolve(__dirname, './dist' + vue_path), }