diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index f49ec270d09..c9d8c57df4b 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -997,6 +997,7 @@ jobs: # lint's type-check and the `build` job's own `next build` (generated route types too) # already enforce. NEXT_BUILD_SKIP_TYPE_CHECK: 'true' + NEXT_BUILD_SKIP_SOURCE_MAPS: 'true' run: bunx turbo run build --filter=@sim/app # Everything `next start` reads, including the spreadsheet parse worker it spawns (named, so a diff --git a/apps/sim/lib/core/config/env.ts b/apps/sim/lib/core/config/env.ts index 5606ea7b2c2..712a558b8c7 100644 --- a/apps/sim/lib/core/config/env.ts +++ b/apps/sim/lib/core/config/env.ts @@ -347,6 +347,7 @@ export const env = createEnv({ // Infrastructure & Deployment NEXT_RUNTIME: z.string().optional(), // Next.js runtime environment DOCKER_BUILD: z.boolean().optional(), // Flag indicating Docker build environment + NEXT_BUILD_SKIP_SOURCE_MAPS: z.boolean().optional(), // Omits unused browser source maps in acceptance builds NEXT_BUILD_SKIP_TYPE_CHECK: z.boolean().optional(), // Skips `next build`'s TypeScript pass where another CI job type-checks // Background Jobs & Scheduling diff --git a/apps/sim/next.config.ts b/apps/sim/next.config.ts index 29ff064d278..e7c5a52ead2 100644 --- a/apps/sim/next.config.ts +++ b/apps/sim/next.config.ts @@ -30,7 +30,7 @@ const nextConfig: NextConfig = { // Safe here since this repo's source is already fully public on GitHub - // no additional exposure versus Next's default (disabled to avoid leaking // source on the client). - productionBrowserSourceMaps: true, + productionBrowserSourceMaps: !isTruthy(env.NEXT_BUILD_SKIP_SOURCE_MAPS), turbopack: { root: path.join(import.meta.dirname, '../..'), }, diff --git a/apps/sim/turbo.json b/apps/sim/turbo.json index 3521e7311fd..4320f58fd80 100644 --- a/apps/sim/turbo.json +++ b/apps/sim/turbo.json @@ -207,7 +207,7 @@ ] }, "build": { - "env": ["NEXT_BUILD_SKIP_TYPE_CHECK"], + "env": ["NEXT_BUILD_SKIP_SOURCE_MAPS", "NEXT_BUILD_SKIP_TYPE_CHECK"], "inputs": [ "$TURBO_DEFAULT$", ".env*",