Repository navigation
Conversation
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
|
@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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
apps/web/vite.config.tsby settingbuild.sourcemapfrom an explicit resolver.WEB_BUILD_SOURCEMAPopt-in (true/1/hidden) to emit hidden source maps for controlled debugging, without enabling public source map URLs.sourcemap: trueoutside production).apps/web/.env.exampleand 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: exportresolveBuildSourcemap(mode, env)and wirebuild.sourcemapto 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: documentsWEB_BUILD_SOURCEMAPopt-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 unrelatedapps/web/src/lib/use-reveal-phase.tsimporting missingroundStatusFromTagfromround-phase.ts(not touched by this PR)Acceptance Criteria
Closes #680