Skip to content

Commit b90984c

Browse files
committed
fix(core): Statically compile import.meta
1 parent 2d67c44 commit b90984c

File tree

2 files changed

+3
-18
lines changed

2 files changed

+3
-18
lines changed

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"scripts": {
2222
"prepare": "pnpm run build",
2323
"emulators:start": "firebase emulators:start -P demo-firebaseui",
24-
"build": "tsup",
24+
"build": "tsup --env.PROD=true",
2525
"build:local": "pnpm run build && pnpm pack",
2626
"dev": "tsup --watch",
2727
"lint": "eslint . --ext .ts",

packages/core/src/index.ts

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,6 @@ export * from "./register-framework";
2727
export * from "./schemas";
2828
export * from "./translations";
2929

30-
// Detect production mode across different build systems (Vite, webpack/Next.js, etc.)
31-
const isDevelopment = typeof process !== "undefined" && process.env.NODE_ENV === "production";
32-
33-
const isViteProduction =
34-
typeof import.meta !== "undefined" &&
35-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
36-
(import.meta as any)?.env &&
37-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
38-
(import.meta as any).env.PROD === true;
39-
40-
// Check if in production mode
41-
const isProduction = isDevelopment || isViteProduction;
42-
43-
if (isProduction) {
44-
// Extract framework name from package name (e.g., "@invertase/firebaseui-react" -> "react")
45-
const frameworkName = pkgJson.name.replace("@invertase/firebaseui-", "");
46-
registerFramework(frameworkName, pkgJson.version);
30+
if (import.meta.env.PROD) {
31+
registerFramework("core", pkgJson.version);
4732
}

0 commit comments

Comments
 (0)