|
15 | 15 | * limitations under the License. |
16 | 16 | */ |
17 | 17 |
|
18 | | -import { registerFramework } from "./register-framework"; |
19 | 18 | import pkgJson from "../package.json"; |
| 19 | +import { registerFramework } from "./register-framework"; |
20 | 20 |
|
21 | 21 | export * from "./auth"; |
22 | 22 | export * from "./behaviors"; |
23 | 23 | export * from "./config"; |
| 24 | +export * from "./country-data"; |
24 | 25 | export * from "./errors"; |
| 26 | +export * from "./register-framework"; |
25 | 27 | export * from "./schemas"; |
26 | | -export * from "./country-data"; |
27 | 28 | export * from "./translations"; |
28 | | -export * from "./register-framework"; |
29 | 29 |
|
30 | | -if (import.meta.env.PROD) { |
31 | | - registerFramework("core", pkgJson.version); |
| 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 | +// eslint-disable-next-line @typescript-eslint/no-explicit-any |
| 34 | +const isViteProduction = (import.meta as any)?.env?.PROD === true; |
| 35 | + |
| 36 | +// Check if in production mode |
| 37 | +const isProduction = isDevelopment || isViteProduction; |
| 38 | + |
| 39 | +if (isProduction) { |
| 40 | + // Extract framework name from package name (e.g., "@invertase/firebaseui-react" -> "react") |
| 41 | + const frameworkName = pkgJson.name.replace("@invertase/firebaseui-", ""); |
| 42 | + registerFramework(frameworkName, pkgJson.version); |
32 | 43 | } |
0 commit comments