Skip to content

Conversation

@alan-agius4
Copy link
Collaborator

This change introduces the ability to disable sourcemaps when running the development server.

A new Vite plugin has been added to remove sourcemap comments from generated assets. The dev server's configuration has been updated to conditionally apply this plugin and control CSS sourcemap generation based on the project's sourceMap setting.

Closes#31331

@alan-agius4alan-agius4 added the target: patch This PR is targeted for the next patch release label Oct 17, 2025
@alan-agius4alan-agius4force-pushed the vite-sourcemap branch 2 times, most recently from ad6d712 to 934f57fCompareOctober 17, 2025 14:01
This change introduces the ability to disable sourcemaps when running the development server. A new Vite plugin has been added to remove sourcemap comments from generated assets. The dev server's configuration has been updated to conditionally apply this plugin and control CSS sourcemap generation based on the project's sourceMap setting. Closesangular#31331

importtype{Plugin}from'vite';

exportconstremoveSourceMapsPlugin: Plugin={
Copy link

@AlonMizAlonMizNov 2, 2025

Choose a reason for hiding this comment

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

isn't "remove sourcemaps" wasteful? meaning the bundler already generated and the cpu/memory resources are wasted. WDYT?

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

Labels

area: @angular/buildtarget: patchThis PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ng serve with esbuild/Vite ignores sourceMap configuration, injecting large inline source maps into all files

2 participants

@alan-agius4@AlonMiz