Skip to content

Conversation

maraf
Copy link
Member

@maraf maraf commented Aug 12, 2025

Follow the pattern from Blazor dotnet/aspnetcore#62558.

Although having the link in the JavaScript files don't cause any requests and so failures until the DevTools are opened, producing such errors/warnings into the console of user applications might cause confusion.

Fixes #98288

@maraf maraf added this to the 10.0.0 milestone Aug 12, 2025
@maraf maraf requested a review from a team August 12, 2025 12:38
@maraf maraf self-assigned this Aug 12, 2025
@Copilot Copilot AI review requested due to automatic review settings August 12, 2025 12:38
@maraf maraf added the arch-wasm WebAssembly architecture label Aug 12, 2025
@maraf maraf added area-Build-mono os-browser Browser variant of arch-wasm labels Aug 12, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modifies the source map generation behavior for browser runtime builds to follow Blazor's pattern. In Release configuration, source maps are now generated as "hidden" (without the source map URL comment in the JavaScript files), while Debug builds continue to include visible source map links.

  • Updates source map generation to be conditional based on build configuration
  • Prevents confusion from browser warnings when source maps are missing in production

Copy link
Member

@pavelsavara pavelsavara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with this change, we don't need sourcemapPathTransform() anymore

@maraf
Copy link
Member Author

maraf commented Aug 12, 2025

with this change, we don't need sourcemapPathTransform() anymore

How come? We still produce the source map, we just omit the comment in the JavaScript file.

@maraf maraf changed the title [browser] Generate source maps as hidden Release configuration [browser] Generate source maps as hidden in Release configuration Aug 12, 2025
@pavelsavara
Copy link
Member

How come? We still produce the source map, we just omit the comment in the JavaScript file.

Fair, LGTM

@pavelsavara pavelsavara merged commit 282b9e6 into main Aug 13, 2025
35 checks passed
@maraf maraf deleted the maraf/BrowserReleaseSourceMaps branch August 13, 2025 08:47
@github-actions github-actions bot locked and limited conversation to collaborators Sep 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-wasm WebAssembly architecture area-Build-mono os-browser Browser variant of arch-wasm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[browser] Strip source map info when source maps are not copied to output folder

3 participants