We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6298c2b commit 19fb6deCopy full SHA for 19fb6de
vite.config.ts
@@ -1,13 +1,21 @@
1
-import { defineConfig } from 'vite'
+import { defineConfig, loadEnv } from 'vite'
2
import deno from '@deno/vite-plugin'
3
import react from '@vitejs/plugin-react-swc'
4
import tailwindcss from 'tailwindcss'
5
+import process from "node:process"
6
// https://vite.dev/config/
-export default defineConfig({
7
- plugins: [deno(), react()],
8
- css: {
9
- postcss: {
10
- plugins: [tailwindcss()],
+export default defineConfig(({mode}) => {
+ const env = loadEnv(mode, process.cwd(), '');
+ return {
+
11
+ plugins: [deno(), react()],
12
+ css: {
13
+ postcss: {
14
+ plugins: [tailwindcss()],
15
+ }
16
+ },
17
+ define: {
18
+ 'import.meta.env.VITE_API_URL': JSON.stringify(env.VITE_API_URL)
19
}
20
21
})
0 commit comments