Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix(build): gate browser sourcemaps behind SHIP_SOURCE_MAPS env var

Louis Beaumontdd7eb9b499d0
diff --git a/apps/screenpipe-app-tauri/next.config.mjs b/apps/screenpipe-app-tauri/next.config.mjs
index 0df3264bf..f1697210c 100644
--- a/apps/screenpipe-app-tauri/next.config.mjs
+++ b/apps/screenpipe-app-tauri/next.config.mjs
@@ -8,11 +8,15 @@ const nextConfig = {
// Disable eslint during builds - we run it separately in CI
ignoreDuringBuilds: true,
},
- // Ship sourcemaps with the prod bundle so React #185 / similar minified
- // stack traces decode to real component + file names in the logs (the
- // bundle is shipped only inside the Tauri app, not over a public CDN,
- // so this isn't an information-disclosure concern).
- productionBrowserSourceMaps: true,
+ // Env-gated. When ON, sourcemaps ship inside the Tauri bundle so React
+ // #185 / similar minified stack traces decode to real component + file
+ // names in the logs. (No CDN exposure — bundle ships in-app.)
+ //
+ // Default OFF because sourcemaps add ~186 MB to the macOS bundle (256 →
+ // 442 MB observed on v2.4.258 vs v2.4.252). Only enable when actively
+ // triaging a minified-stack incident — set SHIP_SOURCE_MAPS=1 in CI for
+ // that release, then flip back. Last triage: v2.4.255 for React #185.
+ productionBrowserSourceMaps: process.env.SHIP_SOURCE_MAPS === '1',
}
export default nextConfig;