Skip to content

docs(config): correct the server.sourcemapIgnoreList default - #23462

Merged
bluwy merged 3 commits into
vitejs:mainfrom
kakiuwang-ui:docs/sourcemap-ignore-list-default
Sep 22, 2026
Merged

bluwy merged 3 commits into
vitejs:mainfrom
kakiuwang-ui:docs/sourcemap-ignore-list-default

Conversation

@kakiuwang-ui

Copy link
Copy Markdown
Contributor

Follow-up to #23437, which changed isInNodeModules from a substring test to a whole-path-segment test. server.sourcemapIgnoreList defaults to that function, so its documented default no longer matches the code.

Three spots in that section still describe the old implementation: the Default: line, the sentence "excludes all paths containing node_modules", and the example.

The example is the one that actually bites. It is labelled "This is the default value", so copying it into a config restores the substring match — and a project living in, say, ~/work/node_modules_bug/ puts its own sources back on the x_google_ignoreList, which is the DevTools symptom #17467 was about.

The regex now shown in the docs is copied verbatim from inNodeModulesRE in packages/vite/src/node/utils.ts, so the two can be diffed by eye.

Docs only, no behaviour change. pnpm run test-docs and pnpm format && git diff --exit-code both pass locally.

https://claude.ai/code/session_01CBv9CTLkwDs3MuPiW3TQ6T

The documented default still described the pre-vitejs#23437 implementation,
`sourcePath.includes('node_modules')`. Since vitejs#23437 the default is
`isInNodeModules`, which only matches `node_modules` as a whole path
segment.

The sample was the most harmful part: it is labelled "This is the default
value", so copying it into a config silently restores the substring match
and puts a project's own sources back on the ignore list whenever the
project path merely contains `node_modules` as part of a longer name.

Claude-Session: https://claude.ai/code/session_01CBv9CTLkwDs3MuPiW3TQ6T
btea
btea previously approved these changes Sep 18, 2026
Comment thread docs/config/server-options.md Outdated
@bluwy
bluwy merged commit 1544bb1 into vitejs:main Sep 22, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants