Skip to content

Commit dadd16c

Browse files
committed
load env
1 parent c13b0fb commit dadd16c

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

vite.config.ts

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
import react from '@vitejs/plugin-react'
2-
import { defineConfig } from 'vite'
2+
import { defineConfig, loadEnv } from 'vite'
33

4-
// https://vitejs.dev/config/
5-
export default defineConfig({
6-
base: '/RubyLive/',
7-
plugins: [react()],
8-
})
4+
export default ({ mode }) => {
5+
// Load app-level env vars to node-level env vars.
6+
process.env = { ...process.env, ...loadEnv(mode, process.cwd()) }
7+
8+
return defineConfig({
9+
base: '/RubyLive/',
10+
plugins: [react()],
11+
})
12+
}

0 commit comments

Comments
 (0)