Added base path to env variables

This commit is contained in:
Florian Sylvain
2023-01-18 00:45:41 +01:00
parent 5b91962952
commit 4fdf75e158
2 changed files with 8 additions and 6 deletions
+7 -6
View File
@@ -1,17 +1,17 @@
import { fileURLToPath, URL } from 'node:url'
import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
import { fileURLToPath, URL } from "node:url"
import { defineConfig, loadEnv } from "vite"
import vue from "@vitejs/plugin-vue"
// https://vitejs.dev/config/
export default defineConfig(({ command, mode }) => {
const env1 = loadEnv(mode, "./../../", "")
const env2 = loadEnv(mode, process.cwd(), "")
return {
return {
plugins: [vue()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
"@": fileURLToPath(new URL("./src", import.meta.url)),
}
},
define: {
@@ -22,6 +22,7 @@ export default defineConfig(({ command, mode }) => {
},
server: {
port: env1.APP_FRONT_PORT,
}
},
base: env1.APP_BASE_FRONT_PATH ?? "/"
}
})