Skip to content

Conversation

ilonatommy
Copy link
Member

@ilonatommy ilonatommy commented Oct 2, 2025

I believe npm run build should not minify js files that it's producing in src\Components\Web.JS\dist\Debug . That's why we're using debug mode. There's a lot of hassle with debugging the minified files now or having to look for the place in rollup to disable minification.

Description

  • do not minify for dist\Debug
  • keep minifying for dist\Release

Before this change:
both dist\Debug and dist\Release had same, minified contents.

Use case:

Replacing packages in user's repro app with the current packs from the repo.

This is just a proposal and should be discussed if there is some real reason why we chose to minify in debug.

@ilonatommy ilonatommy self-assigned this Oct 2, 2025
@ilonatommy ilonatommy requested a review from a team as a code owner October 2, 2025 12:52
@Copilot Copilot AI review requested due to automatic review settings October 2, 2025 12:52
@ilonatommy ilonatommy added area-blazor Includes: Blazor, Razor Components javascript Pull requests that update Javascript code labels Oct 2, 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 prevents JavaScript source minification when building in debug mode by conditionally applying the Terser plugin based on the environment. The change ensures that debug builds produce unminified JavaScript for easier debugging, while release builds continue to use minification for optimization.

  • Conditionally applies Terser minification plugin only in non-development environments
  • Improves debugging experience for development builds

@ilonatommy
Copy link
Member Author

A workaround way from @javiercn:

loading the source maps manually to the browser, following https://developer.chrome.com/docs/devtools/developer-resources.

@ilonatommy ilonatommy closed this Oct 2, 2025
@dotnet-policy-service dotnet-policy-service bot added this to the 11.0-preview1 milestone Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-blazor Includes: Blazor, Razor Components javascript Pull requests that update Javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant