From d83b2160e767de25ed253542c9cb98414d8ccfce Mon Sep 17 00:00:00 2001 From: Anthony Du Pont Date: Wed, 20 Apr 2022 10:16:59 +0200 Subject: [PATCH] :bug: Fix environment loading --- vite.config.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/vite.config.js b/vite.config.js index ba25aeb..919b9b7 100644 --- a/vite.config.js +++ b/vite.config.js @@ -9,10 +9,10 @@ import vue from '@vitejs/plugin-vue' import glsl from 'vite-plugin-glsl' // Custom Configuration -export default ({ mode }) => { +export default defineConfig(({ mode }) => { process.env = { ...process.env, ...loadEnv(mode, process.cwd()) } - return defineConfig({ + return { root: path.join(__dirname, 'src'), build: { outDir: path.join(__dirname, 'dist'), @@ -27,7 +27,8 @@ export default ({ mode }) => { '@@': path.join(__dirname), }, }, + envDir: process.cwd(), envPrefix: 'VUE_', publicDir: path.resolve(__dirname, 'public'), - }) -} + } +})