Packages

webpack-sources

3.7.1 · 18 Nov 2026MIT85.2M / weekRepositoryHomepagenpmAtom feed

Your version

3.5.1

6 Jul 2026Where it was published

3.7.1 is the newest release of 3.x.

In short

2 faster2 fixed

Release note

Patch Changes

  • Stream potential tokens in OriginalSource instead of materialising an array

    OriginalSource.streamChunks (and therefore map() / sourceAndMap()) previously built the full splitIntoPotentialTokens array of substrings and then iterated it — even though map() and sourceAndMap() run with finalSource: true and discard every chunk substring. The scan is now streamed by offset, so chunk substrings are only allocated when actually emitted. This removes the intermediate array and, on the dominant final-source paths, all per-token slices: map() / sourceAndMap() allocate ~38–46% less memory and run ~15–40% faster.

  • Reduce allocations and CPU in map() / sourceAndMap(): mappings are serialized into a reused byte buffer instead of per-mapping strings, ReplaceSource verifies original content through a line-offset index instead of splitting sources into line arrays, and ReplaceSource.streamChunks emits position-only chunks and returns the final source directly when finalSource is requested.

  • Skip sorting ReplaceSource replacements when they were added in order.

  • Use lookup table in splitIntoPotentialTokens for faster character classification

    Replace multi-comparison chains (4 comparisons in phase 1, 6 in phase 2) with a single Uint8Array bitmask lookup per character. This reduces per-character branching overhead, yielding ~7% improvement on typical source and ~21% on large sources.

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.