Skip to content

fix(web): disable production source maps by default - #688

Open
Olajcodes wants to merge 1 commit into
Sub-Rosa-Issue:mainfrom
Olajcodes:fix/web-disable-prod-sourcemaps-680
Open

Olajcodes wants to merge 1 commit into
Sub-Rosa-Issue:mainfrom
Olajcodes:fix/web-disable-prod-sourcemaps-680

Conversation

@Olajcodes

Copy link
Copy Markdown
Contributor

Summary

  • Disable public production source maps by default in apps/web/vite.config.ts by setting build.sourcemap from an explicit resolver.
  • Add WEB_BUILD_SOURCEMAP opt-in (true/1/hidden) to emit hidden source maps for controlled debugging, without enabling public source map URLs.
  • Keep development/test behavior unchanged (sourcemap: true outside production).
  • Document the opt-in in apps/web/.env.example and add a focused build-config test.

Why

Published production source maps can expose internal paths and implementation details unnecessary for the public demo. Defaulting them off reduces that exposure while preserving an explicit, documented debugging escape hatch.

Changes

  • apps/web/vite.config.ts: export resolveBuildSourcemap(mode, env) and wire build.sourcemap to it; default production=false, opt-in=hidden, dev/test=true.
  • apps/web/src/vite-config-sourcemap.test.ts: verifies default-off, explicit opt-in, and dev/test behavior.
  • apps/web/.env.example: documents WEB_BUILD_SOURCEMAP opt-in for controlled debugging.
  • apps/web/package.json: includes the new config test in web test script.

Verification

  • pnpm --filter @sub-rosa/web exec node --import tsx --test src/vite-config-sourcemap.test.ts ✅ (3/3 pass)
  • pnpm --filter @sub-rosa/web build ❌ fails on pre-existing unrelated apps/web/src/lib/use-reveal-phase.ts importing missing roundStatusFromTag from round-phase.ts (not touched by this PR)

Acceptance Criteria

  • Disable public production source maps by default.
  • Permit an explicit documented opt-in for controlled debugging.
  • Keep development source maps unchanged.
  • Add a build-configuration test.

Closes #680

Default web production builds to no public source maps and allow explicit
opt-in hidden source maps via WEB_BUILD_SOURCEMAP for controlled debugging.
Add a build-config test covering default, opt-in, and development behavior.

Closes Sub-Rosa-Issue#680
@drips-wave

drips-wave Bot commented Nov 24, 2026

Copy link
Copy Markdown

@Olajcodes Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

web(high/easy): disable production source maps by default

1 participant