Skip to content

lib: skip source maps in node_modules by default - #67627

Open
legendecas wants to merge 1 commit into
nodejs:mainfrom
legendecas:source-maps-nodemodules
Open

legendecas wants to merge 1 commit into
nodejs:mainfrom
legendecas:source-maps-nodemodules

Conversation

@legendecas

Copy link
Copy Markdown
Member

This updates the flag --enable-source-maps, skipping node_modules and generated code by default.

If source map support for node_modules and generated code are needed, it can be enabled with module.setSourceMapsSupport(). This could improve general app development source map performance.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/loaders

@legendecas legendecas added the semver-major PRs that contain breaking changes and should be released in the next major version. label Nov 19, 2026
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. process Issues and PRs related to the process subsystem. source maps Issues and PRs related to source map support. labels Nov 19, 2026
@legendecas
legendecas force-pushed the source-maps-nodemodules branch from 31514a1 to 7312cac Compare November 19, 2026 22:01
Signed-off-by: Chengzhong Wu <cwu631@bloomberg.net>
@legendecas
legendecas force-pushed the source-maps-nodemodules branch from 7312cac to 7bd74b0 Compare November 19, 2026 22:20
@legendecas legendecas added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 19, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 19, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@codecov

codecov Bot commented Nov 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.72%. Comparing base (f0eb690) to head (7bd74b0).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #67627   +/-   ##
=======================================
  Coverage   90.72%   90.72%           
=======================================
  Files         801      801           
  Lines      280944   280937    -7     
  Branches    54264    54248   -16     
=======================================
+ Hits       254876   254890   +14     
+ Misses      16255    16215   -40     
- Partials     9813     9832   +19     
Files with missing lines Coverage Δ
lib/internal/process/pre_execution.js 96.22% <100.00%> (-0.04%) ⬇️

... and 36 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Frameworks like Next.js need source maps support to support a good debugging experience. I think if we want to do this, we need to add a CLI flag.

Also, this might be semver-major.

Comment thread doc/api/cli.md
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/67627
description: Source maps in `node_modules` and generated code are skipped.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Given there's an option to unskip, it's probably a good idea add "by default"

Suggested change
description: Source maps in `node_modules` and generated code are skipped.
description: Source maps in `node_modules` and generated code are skipped by default.

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

Labels

needs-ci PRs that need a full CI run. process Issues and PRs related to the process subsystem. semver-major PRs that contain breaking changes and should be released in the next major version. source maps Issues and PRs related to source map support.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants