Skip to content

Commit 132bdc3

Browse files
committed
fix: use the right env in env-config plugin
1 parent 2f9195e commit 132bdc3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

frontend/vite-plugins/env-config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import { Plugin } from "vite";
22
import { EnvConfig } from "virtual:env-config";
3+
import { config as dotenvConfig } from "dotenv";
4+
5+
const envFile =
6+
process.env["NODE_ENV"] === "production" ? ".env.production" : ".env";
7+
dotenvConfig({ path: envFile });
38

49
const virtualModuleId = "virtual:env-config";
510
const resolvedVirtualModuleId = "\0" + virtualModuleId;

0 commit comments

Comments
 (0)