Skip to content

Commit

Permalink
chore(env): add FLAT_REGION env
Browse files Browse the repository at this point in the history
  • Loading branch information
crimx committed Mar 30, 2022
1 parent 4e22208 commit 9d9d158
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions web/flat-web/scripts/vite-plugin-dotenv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import path from "path";
import dotenvReal from "dotenv";
import { expand } from "dotenv-expand";
import type { Plugin } from "vite";
import { configRegion } from "../../../scripts/utils/auto-choose-config";

// based on https://github.com/IndexXuan/vite-plugin-env-compatible
export function dotenv(envDir: string): Plugin {
Expand All @@ -25,6 +26,7 @@ export function dotenv(envDir: string): Plugin {
define["process.env.PROD"] = mode === "production";
define["process.env.DEV"] = mode === "development";
define["process.env.NODE_DEV"] = JSON.stringify(mode);
define["process.env.FLAT_REGION"] = JSON.stringify(configRegion());

config.define = { ...config.define, ...define };
}
Expand Down

0 comments on commit 9d9d158

Please sign in to comment.