Skip to content

Commit 4fda239

Browse files
committed
improvement(ci): omit unused source-map processing from E2E builds
1 parent 49fa84a commit 4fda239

4 files changed

Lines changed: 5 additions & 1 deletion

File tree

‎.github/workflows/checks.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,7 @@ jobs:
950950
# lint's type-check and the `build` job's own `next build` (generated route types too)
951951
# already enforce.
952952
NEXT_BUILD_SKIP_TYPE_CHECK: 'true'
953+
NEXT_BUILD_DISABLE_SOURCE_MAPS: 'true'
953954
run: bunx turbo run build --filter=@sim/app
954955

955956
# Everything `next start` reads, including the spreadsheet parse worker it spawns (named, so a

‎apps/sim/lib/core/config/env.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ export const env = createEnv({
336336
// Infrastructure & Deployment
337337
NEXT_RUNTIME: z.string().optional(), // Next.js runtime environment
338338
DOCKER_BUILD: z.boolean().optional(), // Flag indicating Docker build environment
339+
NEXT_BUILD_DISABLE_SOURCE_MAPS: z.boolean().optional(), // Omits source-map processing from builds that do not serve maps
339340
NEXT_BUILD_SKIP_TYPE_CHECK: z.boolean().optional(), // Skips `next build`'s TypeScript pass where another CI job type-checks
340341

341342
// Background Jobs & Scheduling

‎apps/sim/next.config.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const nextConfig: NextConfig = {
3131
// Safe here since this repo's source is already fully public on GitHub -
3232
// no additional exposure versus Next's default (disabled to avoid leaking
3333
// source on the client).
34-
productionBrowserSourceMaps: true,
34+
productionBrowserSourceMaps: !isTruthy(env.NEXT_BUILD_DISABLE_SOURCE_MAPS),
3535
turbopack: {
3636
root: path.join(import.meta.dirname, '../..'),
3737
},
@@ -169,6 +169,7 @@ const nextConfig: NextConfig = {
169169
],
170170
},
171171
experimental: {
172+
turbopackInputSourceMaps: !isTruthy(env.NEXT_BUILD_DISABLE_SOURCE_MAPS),
172173
/**
173174
* Turbopack's dev filesystem cache stays ON (this is also the Next default
174175
* since v16.1). It is what makes a dev-server restart cheap: without it every

‎apps/sim/turbo.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@
165165
]
166166
},
167167
"build": {
168+
"env": ["NEXT_BUILD_DISABLE_SOURCE_MAPS", "NEXT_BUILD_SKIP_TYPE_CHECK"],
168169
"inputs": [
169170
"$TURBO_DEFAULT$",
170171
".env*",

0 commit comments

Comments
 (0)