feat: conditional build - #379
Conversation
📦 Next.js Bundle AnalysisThis analysis was generated by the next.js bundle analysis action 🤖 🎉 Global Bundle Size Decreased
DetailsThe global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster. Any third party scripts you have added directly to your app using the If you want further insight into what is behind the changes, give @next/bundle-analyzer a try! Eight Pages Changed SizeThe following pages changed size from the code in this PR compared to its base branch:
DetailsOnly the gzipped size is provided here based on an expert tip. First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If Any third party scripts you have added directly to your app using the Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. |
|
|
|
The showcase was gated only by client-side NODE_ENV checks. Since next build sets NODE_ENV=production, the route existed and was fetchable on every deployed build — including Vercel previews, where it rendered blank — while all ~29 showcase modules still shipped in the production bundle. Unusable where it was wanted, shipped where it wasn't. Gates it via pageExtensions instead, the same build-time mechanism already used for the *.governance.tsx pages (PR #379, 'feat: conditional build'). Renaming the pages to *.dev.tsx means Next never sees them unless that extension is registered: no route, no chunk, a real 404 rather than a blank page. The now-redundant NODE_ENV guards are removed — they would have kept the page blank on preview. VERCEL_ENV is Vercel's documented system variable for per-environment behaviour, so previews work with no dashboard setup. The VERCEL_ENV !== 'production' veto is deliberate: without it the gate is purely additive, and NEXT_PUBLIC_ENABLE_DEV_PAGES=true left scoped to all environments would leak the showcase into production.
Uh oh!
There was an error while loading. Please reload this page.