Skip to content

Commit 19fb6de

Browse files
committed
one more time
1 parent 6298c2b commit 19fb6de

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

vite.config.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
1-
import { defineConfig } from 'vite'
1+
import { defineConfig, loadEnv } from 'vite'
22
import deno from '@deno/vite-plugin'
33
import react from '@vitejs/plugin-react-swc'
44
import tailwindcss from 'tailwindcss'
5+
import process from "node:process"
56
// https://vite.dev/config/
6-
export default defineConfig({
7-
plugins: [deno(), react()],
8-
css: {
9-
postcss: {
10-
plugins: [tailwindcss()],
7+
export default defineConfig(({mode}) => {
8+
const env = loadEnv(mode, process.cwd(), '');
9+
return {
10+
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)
1119
}
1220
}
1321
})

0 commit comments

Comments
 (0)