make VUE_PATH as env-variable and use "/" as default if no .env exist

This commit is contained in:
einhornimmond 2021-03-29 19:08:30 +02:00
parent 90d8b60cc4
commit 8535730f94
2 changed files with 10 additions and 3 deletions

View File

@ -1,3 +1,4 @@
LOGIN_API_URL=http://localhost/login_api/ LOGIN_API_URL=http://localhost/login_api/
COMMUNITY_API_STATE_BALANCE_URL=http://localhost/state-balances/ COMMUNITY_API_STATE_BALANCE_URL=http://localhost/state-balances/
COMMUNITY_API_TRANSACTION_CREATION_URL=http://localhost/transaction-creations/ COMMUNITY_API_TRANSACTION_CREATION_URL=http://localhost/transaction-creations/
VUE_PATH=/vue

View File

@ -4,6 +4,12 @@ const dotenv = require('dotenv-webpack')
function resolveSrc(_path) { function resolveSrc(_path) {
return path.join(__dirname, _path) return path.join(__dirname, _path)
} }
let vue_path = process.env.VUE_PATH
if(vue_path == undefined) {
vue_path = ""
}
// vue.config.js // vue.config.js
module.exports = { module.exports = {
pluginOptions: { pluginOptions: {
@ -15,7 +21,7 @@ module.exports = {
}, },
}, },
lintOnSave: true, lintOnSave: true,
publicPath: '/vue/', publicPath: vue_path + '/',
configureWebpack: { configureWebpack: {
// Set up all the aliases we use in our app. // Set up all the aliases we use in our app.
resolve: { resolve: {
@ -29,5 +35,5 @@ module.exports = {
// Enable CSS source maps. // Enable CSS source maps.
sourceMap: process.env.NODE_ENV !== 'production', sourceMap: process.env.NODE_ENV !== 'production',
}, },
outputDir: path.resolve(__dirname, './dist/vue'), outputDir: path.resolve(__dirname, './dist' + vue_path),
} }