From 6babdf38a5d5271ef6e62cc59b25a638c6e30a61 Mon Sep 17 00:00:00 2001 From: Jacob Wolf Date: Tue, 21 Oct 2025 19:31:03 -0500 Subject: [PATCH] fix: make next environment variables optional, externalize react runtime --- packages/platform/atoms/vite.config.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/platform/atoms/vite.config.ts b/packages/platform/atoms/vite.config.ts index 4cbf2b5376e4ac..34cf9415e73688 100644 --- a/packages/platform/atoms/vite.config.ts +++ b/packages/platform/atoms/vite.config.ts @@ -7,6 +7,9 @@ import dts from "vite-plugin-dts"; export default defineConfig(({ mode }) => { const env = loadEnv(mode, process.cwd(), ""); // .env inside of packages/platform/atoms const webAppUrl = env.NEXT_PUBLIC_WEBAPP_URL ?? "https://app.cal.com"; + const calcomVersion = env.NEXT_PUBLIC_CALCOM_VERSION ?? ""; + const vercelCommitSha = env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA ?? ""; + return { optimizeDeps: { include: [ @@ -38,6 +41,8 @@ export default defineConfig(({ mode }) => { ], define: { "process.env.NEXT_PUBLIC_WEBAPP_URL": `"${webAppUrl}"`, + "process.env.NEXT_PUBLIC_CALCOM_VERSION": `"${calcomVersion}"`, + "process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA": `"${vercelCommitSha}"`, }, ssr: { noExternal: ["turndown"], // Example if you want to disable SSR for your library @@ -59,12 +64,14 @@ export default defineConfig(({ mode }) => { "react-dom", "react-dom/client", "@prisma/client", + "react/jsx-dev-runtime", ], output: { format: "esm", globals: { react: "React", "react-dom": "ReactDOM", + "react/jsx-runtime": "ReactJsxRuntime", }, }, },