webpack-sources
3.7.1 · 18 Nov 2026MIT85.2M / weekRepositoryHomepagenpmAtom feed
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 thereforemap()/sourceAndMap()) previously built the fullsplitIntoPotentialTokensarray of substrings and then iterated it — even thoughmap()andsourceAndMap()run withfinalSource: trueand 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,ReplaceSourceverifies original content through a line-offset index instead of splitting sources into line arrays, andReplaceSource.streamChunksemits position-only chunks and returns the final source directly whenfinalSourceis 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.