diff --git a/vite.config.ts b/vite.config.ts index ce22ed1..aa08414 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,8 +1,12 @@ import react from '@vitejs/plugin-react' -import { defineConfig } from 'vite' +import { defineConfig, loadEnv } from 'vite' -// https://vitejs.dev/config/ -export default defineConfig({ - base: '/RubyLive/', - plugins: [react()], -}) +export default ({ mode }) => { + // Load app-level env vars to node-level env vars. + process.env = { ...process.env, ...loadEnv(mode, process.cwd()) } + + return defineConfig({ + base: '/RubyLive/', + plugins: [react()], + }) +}