Added API PORT to devServer

This commit is contained in:
Florian Sylvain
2022-12-23 20:35:20 +01:00
parent c49a28be83
commit eee7c1e067
+8 -2
View File
@@ -4,6 +4,9 @@ import vue from '@vitejs/plugin-vue'
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig(({ command, mode }) => { export default defineConfig(({ command, mode }) => {
const env1 = loadEnv(mode, "./../../", "")
const env2 = loadEnv(mode, process.cwd(), "")
return { return {
plugins: [vue()], plugins: [vue()],
resolve: { resolve: {
@@ -13,9 +16,12 @@ export default defineConfig(({command, mode}) => {
}, },
define: { define: {
__APP_ENV__: { __APP_ENV__: {
...loadEnv(mode, "./../../", ""), // when running directly | access .env from ./web/admin-gui/ ...env1,
...loadEnv(mode, process.cwd(), ""), // when running from docker ...env2,
} }
},
server: {
port: env1.APP_FRONT_PORT,
} }
} }
}) })