Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(@angular/build): allow disabling sourcemaps in the dev server #31510

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
alan-agius4 wants to merge 1 commit into angular:main
base: main
Choose a base branch
Loading
from alan-agius4:vite-sourcemap

Conversation

@alan-agius4
Copy link
Collaborator

@alan-agius4 alan-agius4 commented Oct 17, 2025

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-agius4 alan-agius4 added the target: patch This PR is targeted for the next patch release label Oct 17, 2025
@alan-agius4 alan-agius4 force-pushed the vite-sourcemap branch 2 times, most recently from ad6d712 to 934f57f Compare October 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.
Closes angular#31331 

import type { Plugin } from 'vite';

export const removeSourceMapsPlugin: Plugin = {
Copy link

@AlonMiz AlonMiz Nov 2, 2025
edited
Loading

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 free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer

@AlonMiz AlonMiz AlonMiz left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

area: @angular/build target: patch This PR is targeted for the next patch release

Projects

None yet

Milestone

No milestone

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

AltStyle によって変換されたページ (->オリジナル) /