Skip to content

fix: preserve literals when extracting source maps - #22768

Merged
alexander-akait merged 1 commit into
mainfrom
fix/source-map-string-directives
Oct 18, 2026
Merged

alexander-akait merged 1 commit into
mainfrom
fix/source-map-string-directives

Conversation

@bjohansebas

@bjohansebas bjohansebas commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

Summary

With module.rules[].extractSourceMap: true, directives inside literals can trigger missing-file warnings or change string contents. Scan trailing comments and remove their exact range, preserving literals and JavaScript/CSS block directives.

Observed with a valid real.map beside this module:

module.exports = `//# sourceMappingURL=real.map
`;
Export before: ""
Export after:  "//# sourceMappingURL=real.map\n"

Cache line starts and combine block checks. Instrumenting a real build with 128 trailing blocks gave:

Operation Repeated prefix scan Cached line start
Line-break checks 2,851,287 24,151
Substring calls 516 129

Seven comparison builds emitted identical files. These count operations, not elapsed time; the added benchmark covers development, production and rebuilds.

References: Rspack fix #15969, original report #15950, and ECMA-426 extraction without parsing.

What kind of change does this PR introduce?

fix

Did you add tests for your changes?

Yes: extractSourceMap.unittest.js, configCases/source-map/extract-source-map-strings, and benchmarkCases/extract-source-map. All 84 targeted tests pass, including persistent cache, with full coverage of changed executable lines/branches. Benchmarks, types, ESLint, formatting and spellcheck pass.

Local yarn lint setup and the generated CSS check fail identically on unchanged main; all other lint stages pass.

Does this PR introduce a breaking change?

No API change. Non-trailing or ambiguous directives, including malformed quoted URLs, are deliberately ignored to preserve source; ambiguous block tails can leave a map unextracted.

If relevant, what needs to be documented once your changes are merged or what have you already documented?

Added a patch changeset; no new configuration.

Use of AI

Codex helped compare Rspack's fix, reproduce the bug, implement and optimize extraction, add tests, run validation, and draft this description.

Summary by CodeRabbit

  • Bug Fixes
    • Source-map directives are now extracted only from valid trailing comments. Similar text inside strings, templates, regular expressions, or ordinary comments remains unchanged.
    • Extraction preserves the surrounding source content and correctly handles consecutive comments and different line separators.

@changeset-bot

changeset-bot Bot commented Oct 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5e868ee

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
webpack Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added the area: build-perf Build time and memory of webpack itself label Oct 18, 2026
@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

This PR is packaged and the instant preview is available (3821900).

Install it locally:

  • npm
npm i -D webpack@https://pkg.pr.new/webpack@3821900
  • yarn
yarn add -D webpack@https://pkg.pr.new/webpack@3821900
  • pnpm
pnpm add -D webpack@https://pkg.pr.new/webpack@3821900

@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: webpack/webpack/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 81279ab2-7ebc-4d8d-9275-35ad7ac31ed7
📥 Commits

Reviewing files that changed from the base of the PR and between e1c10dc and 5e868ee.

⛔ Files ignored due to path filters: 4
  • test/configCases/source-map/extract-source-map-strings/block.js.map is excluded by !**/*.map
  • test/configCases/source-map/extract-source-map-strings/mapped.js.map is excluded by !**/*.map
  • test/configCases/source-map/extract-source-map-strings/style.css.map is excluded by !**/*.map
  • test/unitCases/__snapshots__/extractSourceMap.unittest.js.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
📒 Files selected for processing: 13
  • .changeset/060-source-map-string-directives.md
  • lib/module/extractSourceMap.js
  • test/benchmarkCases/extract-source-map/options.mjs
  • test/benchmarkCases/extract-source-map/webpack.config.mjs
  • test/configCases/source-map/extract-source-map-strings/block.js
  • test/configCases/source-map/extract-source-map-strings/index.js
  • test/configCases/source-map/extract-source-map-strings/mapped.js
  • test/configCases/source-map/extract-source-map-strings/regex-class.js
  • test/configCases/source-map/extract-source-map-strings/regex-escaped.js
  • test/configCases/source-map/extract-source-map-strings/strings.js
  • test/configCases/source-map/extract-source-map-strings/style.css
  • test/configCases/source-map/extract-source-map-strings/webpack.config.js
  • test/unitCases/extractSourceMap.unittest.js

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📝 Walkthrough

The source-map extractor now scans trailing comments for directives and removes the matched comment by its recorded offset. Unit and configuration tests cover directive-like text in strings and comments. A benchmark fixture includes a source map and 128 trailing comments.

Changes: Source-map directive extraction

Layer / File(s) Summary
Trailing comment scanning and removal
lib/module/extractSourceMap.js, test/unitCases/extractSourceMap.unittest.js, .changeset/060-source-map-string-directives.md
The extractor scans backward through trailing comments, returns the matched comment's start offset, and removes that exact range. Unit tests cover trailing comment forms, ambiguous content, line separators, and matching offsets.
String and CSS extraction tests
test/configCases/source-map/extract-source-map-strings/*
Fixtures and assertions cover source-map-like text in JavaScript literals and regular expressions, plus JavaScript and CSS source-map comments.
Source-map extraction benchmark fixture
test/benchmarkCases/extract-source-map/*
The benchmark setup writes a JavaScript fixture with 128 trailing comments and an associated source map. Its webpack configuration enables source-map generation and extraction.

Suggested labels: area: sourcemaps

Suggested reviewers: xiaoxiaojx

Priority: ➖ Normal

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 5e868

The source-map extraction change is mergeable after normal checks; no concrete regression remains identified.

Pre-merge checks: Passed 3 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Title check Inconclusive The title uses valid Conventional Commit syntax and accurately describes the source-map extraction fix. The required branch-prefix match cannot be verified because the branch name is not provided. Provide the branch name or confirm that its prefix is "fix".
Passed Passed checks: 3 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

✨ Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR

@github-actions

Copy link
Copy Markdown
Contributor

Types Coverage

Coverage after merging fix/source-map-string-directives into main will be
99.24%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
bin
   webpack.js98.86%100%100%98.86%113
declarations
   WebpackOptions.ts99.94%100%100%99.94%4238
examples
   build-common.js100%100%100%100%
   buildAll.js100%100%100%100%
   examples.js100%100%100%100%
   template-common.js98.21%100%100%98.21%72
examples/custom-javascript-parser
   test.filter.js100%100%100%100%
examples/custom-javascript-parser/internals
   acorn-parse.js100%100%100%100%
   meriyah-parse.js100%100%100%100%
   oxc-parse.js100%100%100%100%
examples/markdown
   webpack.config.mjs100%100%100%100%
examples/module-federation
   test.filter.js100%100%100%100%
examples/reexport-components
   test.filter.js100%100%100%100%
examples/ssr
   test.filter.js100%100%100%100%
examples/typescript
   test.filter.js100%100%100%100%
examples/typescript-non-erasable
   test.filter.js50%100%100%50%5
examples/virtual-modules
   test.filter.js100%100%100%100%
examples/wasm-bindgen-esm
   test.filter.js100%100%100%100%
examples/wasm-complex
   test.filter.js100%100%100%100%
examples/wasm-emscripten
   test.filter.js100%100%100%100%
examples/wasm-simple
   test.filter.js100%100%100%100%
examples/wasm-simple-source-phase
   test.filter.js100%100%100%100%
lib
   Chunk.js100%100%100%100%
   Compilation.js98.71%100%100%98.71%1779, 2092, 2099, 2107, 2129, 2132, 3116, 3667, 3710, 4299, 4303, 4430, 4451, 4576, 4613, 4620, 4673–4674, 4678, 4683, 4699–4700, 4714–4715, 4720–4721, 5245, 5271, 6101, 6118, 6136, 6152, 6167, 6192, 6195, 6563, 6566–6567, 6572, 6587, 6670, 6694, 851–852
   Compiler.js98.81%100%100%98.81%1116, 1153, 1156, 1336–1337, 1345, 848, 934, 975
   Dependency.js100%100%100%100%
   DependencyTemplate.js100%100%100%100%
   EntryPlugin.js100%100%100%100%
   Entrypoint.js100%100%100%100%
   ExternalsPlugin.js100%100%100%100%
   FileSystemInfo.js100%100%100%100%
   InitFragment.js100%100%100%100%
   LibraryTemplatePlugin.js100%100%100%100%
   ModuleFilenameHelpers.js100%100%100%100%
   ModuleNotFoundError.js100%100%100%100%
   MultiCompiler.js98.91%100%100%98.91%489, 561, 748, 813
   NormalModule.js100%100%100%100%
   NullFactory.js100%100%100%100%
   ProgressPlugin.js100%100%100%100%
   RawModule.js100%100%100%100%
   RequestShortener.js100%100%100%100%
   SingleEntryPlugin.js100%100%100%100%
   WebpackError.js100%100%100%100%
   index.js100%100%100%100%
   webpack.js98.59%100%100%98.59%306, 308
lib/asset
   AssetBytesGenerator.js100%100%100%100%
   AssetBytesParser.js91.67%100%100%91.67%27
   AssetGenerator.js100%100%100%100%
   AssetModule.js100%100%100%100%
   AssetModulesPlugin.js98.45%100%100%98.45%334, 360, 363, 493, 58
   AssetParser.js96.15%100%100%96.15%47
   AssetSourceGenerator.js100%100%100%100%
   AssetSourceParser.js91.67%100%100%91.67%27
   RawDataUrlModule.js100%100%100%100%
   WebManifestGenerator.js100%100%100%100%
   WebManifestParser.js100%100%100%100%
lib/async-modules
   AsyncModuleHelpers.js100%100%100%100%
   AwaitDependenciesInitFragment.js100%100%100%100%
   InferAsyncModulesPlugin.js100%100%100%100%
   isGeneratorLowered.js100%100%100%100%
lib/bun
   BunTargetPlugin.js100%100%100%100%
lib/cache
   AddBuildDependenciesPlugin.js100%100%100%100%
   AddManagedPathsPlugin.js100%100%100%100%
   Cache.js98.25%100%100%98.25%104
   CacheFacade.js100%100%100%100%
   IdleFileCachePlugin.js97.92%100%100%97.92%75, 87, 95
   MemoryCachePlugin.js92%100%100%92%33, 42
   MemoryWithGcCachePlugin.js93.42%100%100%93.42%106, 120–121, 130, 88
   PackFileCacheStrategy.js96.54%100%100%96.54%1306, 1406, 1410, 1472, 1718, 1802, 1825, 1855, 684, 703, 713–715, 717, 733–734, 739, 742, 744, 749, 754, 779, 785, 819, 825, 831, 836, 847, 856, 861–862, 864, 881, 887–888, 890
   ResolverCachePlugin.js100%100%100%100%
   getLazyHashedEtag.js100%100%100%100%
   mergeEtags.js100%100%100%100%
lib/config
   OptionsApply.js100%100%100%100%
   PlatformPlugin.js100%100%100%100%
   WebpackOptionsApply.js100%100%100%100%
   WebpackOptionsDefaulter.js100%100%100%100%
   browserslistTargetHandler.js100%100%100%100%
   cli.js98.89%100%100%98.89%114, 550, 582, 632
   defaults.js99.59%100%100%99.59%1633–1635, 1643, 288, 548
   defineConfig.js100%100%100%100%
   getClaimedAssetTypes.js100%100%100%100%
   normalization.js99.14%100%100%99.14%285–286, 356, 371
   target.js100%100%100%100%
   validateSchema.js94.67%100%100%94.67%100, 87, 89, 98
lib/container
   ContainerEntryDependency.js100%100%100%100%
   ContainerEntryModule.js100%100%100%100%
   ContainerEntryModuleFactory.js100%100%100%100%
   ContainerExposedDependency.js100%100%100%100%
   ContainerPlugin.js100%100%100%100%
   ContainerReferencePlugin.js100%100%100%100%
   FallbackDependency.js100%100%100%100%
   FallbackItemDependency.js100%100%100%100%
   FallbackModule.js100%100%100%100%
   FallbackModuleFactory.js100%100%100%100%
   HoistContainerReferencesPlugin.js100%100%100%100%
   ModuleFederationPlugin.js100%100%100%100%
   RemoteModule.js100%100%100%100%
   RemoteRuntimeModule.js100%100%100%100%
   RemoteToExternalDependency.js100%100%100%100%
   declaredRemotes.js100%100%100%100%
   moduleFederationHooks.js100%100%100%100%
   options.js100%100%100%100%
lib/context
   ContextExclusionPlugin.js100%100%100%100%
   ContextModule.js99.88%100%100%99.88%1495
   ContextModuleFactory.js95.70%100%100%95.70%230, 257, 276, 280–281, 289, 466, 487, 492, 534, 543, 545, 549, 552, 558–559
   ContextReplacementPlugin.js100%100%100%100%
lib/css
   CssGenerator.js99.29%100%100%99.29%1094, 129, 305, 847
   CssInjectStyleRuntimeModule.js100%100%100%100%
   CssLoadingRuntimeModule.js100%100%100%100%
   CssModule.js100%100%100%100%
   CssModulesPlugin.js98.72%100%100%98.72%217, 418, 432, 445, 458, 481, 494, 507, 520
   CssParser.js99.76%100%100%99.76%1090, 2425, 3072, 3075, 3081, 3514, 943
   CssServerStylesRuntimeModule.js100%100%100%100%
   conventions.js98.65%100%100%98.65%93
   cssMinify.js100%100%100%100%
   data.js99.84%100%100%99.84%229, 5601
   syntax-parser.js99.69%100%100%99.69%10787–10788, 11326–11327, 11364, 11574, 11623, 13941, 14002–14005, 14110–14111, 14209–14210, 14929, 15226, 15228, 15748, 16114, 18257, 2619, 3326, 3328, 3333, 3352, 4101, 4107
   syntax-printer.js99.33%100%100%99.33%2603–2604, 2606–2607, 2609–2610, 2615, 2885–2888, 2981, 353, 3666, 4091, 4227, 4927, 5238, 6026, 727
   syntax.js100%100%100%100%
   topologicalSort.js100%100%100%100%
lib/debug
   ProfilingPlugin.js97.35%100%100%97.35%582, 589, 598, 602, 611, 616, 622, 627
lib/define
   DefinePlugin.js99.42%100%100%99.42%1488, 936, 938, 943, 967
   DotenvPlugin.js97.58%100%100%97.58%276, 391, 439, 452–453
   EnvironmentPlugin.js100%100%100%100%
lib/deno
   DenoTargetPlugin.js100%100%100%100%
lib/dependencies
   ConstDependency.js100%100%100%100%
   ContextElementDependency.js100%100%100%100%
   NullDependency.js100%100%100%100%
lib/dependencies/amd
   AMDDefineDependency.js100%100%100%100%
   AMDDefineDependencyParserPlugin.js100%100%100%100%
   AMDPlugin.js99.31%100%100%99.31%54
   AMDRequireArrayDependency.js100%100%100%100%
   AMDRequireContextDependency.js100%100%100%100%
   AMDRequireDependenciesBlock.js100%100%100%100%
   AMDRequireDependenciesBlockParserPlugin.js100%100%100%100%
   AMDRequireDependency.js100%100%100%100%
   AMDRequireItemDependency.js100%100%100%100%
   AMDRuntimeModules.js95.45%100%100%95.45%65
   LocalModule.js100%100%100%100%
   LocalModuleDependency.js100%100%100%100%
   LocalModulesHelpers.js100%100%100%100%
   RequireJsStuffPlugin.js100%100%100%100%
   UnsupportedDependency.js100%100%100%100%
lib/dependencies/commonjs
   

@coderabbitai coderabbitai Bot added the area: sourcemaps devtool and source map generation label Oct 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Generated code size

Comparing base (e1c10dc) to head (5e868ee). Merging this pull request adds 4 new asset(s).

What moved Tests Assets Gzip Raw Test edit
Changed, test untouched 0 0 — — —
Changed, test edited 0 0 — — —
New 1 4 ⚪ added +2.91 KiB ⚪ added +8.04 KiB —
Deleted 0 0 — — —
Unchanged — 8988 — — —

Read Changed, test untouched first: the test is byte-identical on both sides, so webpack generated the difference. Changed, test edited moved partly because the test did — Test edit is how many bytes the test gained, and a bundle that grew by less is not a regression. New and Deleted are whole files, not deltas — a new asset was created, not grown, so it reads gray (⚪ added) — and adding tests cannot bury a real change. Gzip decides, because that is what users download; raw is the tiebreak, and brotli and zstd are per asset below.

No asset that both runs emit changed size — everything below is new or deleted.

4 asset(s) this pull request adds
Asset Raw Gzip (9) Brotli (11) Zstd (19)
⚪ added source-map/extract-source-map-strings bundle0.js.map 4.18 KiB 1.47 KiB 1.29 KiB 1.45 KiB
⚪ added source-map/extract-source-map-strings bundle0.js 3.59 KiB 1.20 KiB 1.03 KiB 1.19 KiB
⚪ added source-map/extract-source-map-strings bundle0.css.map 177 B 151 B 112 B 138 B
⚪ added source-map/extract-source-map-strings bundle0.css 100 B 99 B 77 B 91 B

No runtime that both runs build changed which runtime modules it carries.

1 runtime(s) this pull request adds or no longer builds
Runtime Modules
➕ source-map/extract-source-map-strings main 1

Built test/configCases with the defaults a user gets: 2256 test(s), 8992 asset(s), 101 emitted nothing.

@codecov

codecov Bot commented Oct 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.48%. Comparing base (e1c10dc) to head (5e868ee).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #22768   +/-   ##
=======================================
  Coverage   96.48%   96.48%           
=======================================
  Files         778      778           
  Lines      137320   137351   +31     
  Branches    46550    46565   +15     
=======================================
+ Hits       132488   132522   +34     
+ Misses       4832     4829    -3     
Flag Coverage Δ
css-parsing 24.76% <ø> (ø)
html5lib 26.55% <ø> (ø)
integration 81.29% <95.00%> (+<0.01%) ⬆️
minify-corpora 90.86% <ø> (ø)
syntax-equivalence 76.57% <ø> (ø)
test262 55.78% <ø> (ø)
test262-parser 79.42% <ø> (ø)
unit 76.52% <97.50%> (+<0.01%) ⬆️
xmlconf 27.52% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 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.

@codspeed

codspeed Bot commented Oct 18, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 5.71%

⚠️ 111 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

ℹ️ 31 benchmarks have no flame graph

The flamegraph could not be generated because too much time was spent in runtime internals, making the visualization not useful for performance analysis.

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 3 improved benchmarks
❌ 2 regressed benchmarks
✅ 401 untouched benchmarks
🆕 6 new benchmarks
⏩ 6 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Memory unit benchmark "html-printer-document-unit", minify (wide table) 33.8 KB 167.3 KB -79.8%
❌ Memory benchmark "no-concatenation", scenario '{"name":"mode-development","mode":"development"}' 1.2 MB 1.7 MB -29.13%
⚡ Memory unit benchmark "html-printer-document-unit", minify (composed subtrees) 666.2 KB 279.1 KB ×2.4
⚡ Memory unit benchmark "js-parser-unit", sourceType 'module' 1,125 KB 635.8 KB +76.93%
⚡ Memory benchmark "asset-modules-bytes", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' 236.8 KB 192.2 KB +23.24%
🆕 ⚠️ Simulation benchmark "extract-source-map", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' N/A 126.6 ms N/A
🆕 ⚠️ Simulation benchmark "extract-source-map", scenario '{"name":"mode-development","mode":"development"}' N/A 140.1 ms N/A
🆕 ⚠️ Simulation benchmark "extract-source-map", scenario '{"name":"mode-production","mode":"production"}' N/A 771 ms N/A
🆕 Memory benchmark "extract-source-map", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' N/A 170.8 KB N/A
🆕 Memory benchmark "extract-source-map", scenario '{"name":"mode-development","mode":"development"}' N/A 400.2 KB N/A
🆕 Memory benchmark "extract-source-map", scenario '{"name":"mode-production","mode":"production"}' N/A 355.6 KB N/A

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing fix/source-map-string-directives (5e868ee) with main (e1c10dc)

Open in CodSpeed

Footnotes

  1. 6 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@alexander-akait
alexander-akait merged commit 3821900 into main Oct 18, 2026
68 of 70 checks passed
@alexander-akait
alexander-akait deleted the fix/source-map-string-directives branch October 18, 2026 21:55
markharding pushed a commit to futo-org/Harbor that referenced this pull request Oct 27, 2026
This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [webpack](https://github.com/webpack/webpack) | [`5.112.0` → `5.112.2`](https://renovatebot.com/diffs/npm/webpack/5.112.0/5.112.2) | ![age](https://developer.mend.io/api/mc/badges/age/npm/webpack/5.112.2?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/webpack/5.112.0/5.112.2?slim=true) |

---

> ⚠️ **Warning**
>
> Some dependencies could not be looked up. Check the [Dependency Dashboard](issues/99) for more information.

---

### Release Notes

<details>
<summary>webpack/webpack (webpack)</summary>

### [`v5.112.2`](https://github.com/webpack/webpack/blob/HEAD/CHANGELOG.md#51122)

[Compare Source](webpack/webpack@v5.112.1...v5.112.2)

##### Patch Changes

- Reduce repeated scans when concatenating imported modules. (by [@&#8203;xiaoxiaojx](https://github.com/xiaoxiaojx) in [#&#8203;22865](webpack/webpack#22865))

- Avoid allocating CSS module sets for single-group chunks. (by [@&#8203;xiaoxiaojx](https://github.com/xiaoxiaojx) in [#&#8203;22866](webpack/webpack#22866))

- Return the value of every module type loaded with `importModule()`. (by [@&#8203;alexander-akait](https://github.com/alexander-akait) in [#&#8203;22869](webpack/webpack#22869))

### [`v5.112.1`](https://github.com/webpack/webpack/blob/HEAD/CHANGELOG.md#51121)

[Compare Source](webpack/webpack@v5.112.0...v5.112.1)

##### Patch Changes

- Rebuild a lazy barrel in watch when what it defers changes, and keep the imports and re-exports it still runs. (by [@&#8203;aryanraj45](https://github.com/aryanraj45) in [#&#8203;22699](webpack/webpack#22699))

- Rebuild under `cacheUnaffected` a module whose re-export target goes or returns. (by [@&#8203;aryanraj45](https://github.com/aryanraj45) in [#&#8203;22749](webpack/webpack#22749))

- Fix "Self-reference dependency has unused export name" for CommonJS namespace re-exports. (by [@&#8203;alexander-akait](https://github.com/alexander-akait) in [#&#8203;22791](webpack/webpack#22791))

- Fix `exportType: "style"` CSS modules throwing outside the runtime chunk. (by [@&#8203;lazerg](https://github.com/lazerg) in [#&#8203;22833](webpack/webpack#22833))

- Fix crash when a CSS module with `exportType: "style"` imports an ignored stylesheet. (by [@&#8203;codeXsidd](https://github.com/codeXsidd) in [#&#8203;22846](webpack/webpack#22846))

- Keep empty process environment variables that `.env` files don't define in `DotenvPlugin`. (by [@&#8203;alexander-akait](https://github.com/alexander-akait) in [#&#8203;22794](webpack/webpack#22794))

- Rehash an ESM entry chunk when a chunk it imports by file name changes. (by [@&#8203;alexander-akait](https://github.com/alexander-akait) in [#&#8203;22804](webpack/webpack#22804))

- Handle a NUL inside an HTML CDATA section the way the parsing spec does. (by [@&#8203;dependabot](https://github.com/apps/dependabot) in [#&#8203;22811](webpack/webpack#22811))

- Keep module exports live across chunks, runtimes, HMR and eval, sparing globals. (by [@&#8203;alexander-akait](https://github.com/alexander-akait) in [#&#8203;22733](webpack/webpack#22733))

- Await asynchronous modules that `ProvidePlugin` injects into ES modules. (by [@&#8203;alexander-akait](https://github.com/alexander-akait) in [#&#8203;22728](webpack/webpack#22728))

- Keep a resolve that ends after the compiler closed from throwing. (by [@&#8203;alexander-akait](https://github.com/alexander-akait) in [#&#8203;22795](webpack/webpack#22795))

- Preserve string names passed to SharedWorker constructors. (by [@&#8203;bjohansebas](https://github.com/bjohansebas) in [#&#8203;22770](webpack/webpack#22770))

- Preserve string contents when extracting source map comments. (by [@&#8203;bjohansebas](https://github.com/bjohansebas) in [#&#8203;22768](webpack/webpack#22768))

- Scope strict-mode, async and generator block function declarations to their block. (by [@&#8203;alexander-akait](https://github.com/alexander-akait) in [#&#8203;22800](webpack/webpack#22800))

- Preserve raw dotenv values when reusing cached environment files. (by [@&#8203;Eshiv-Pandey](https://github.com/Eshiv-Pandey) in [#&#8203;22787](webpack/webpack#22787))

- Preserve assigned or patched built-ins, conversions and pattern targets. (by [@&#8203;aryanraj45](https://github.com/aryanraj45) in [#&#8203;22761](webpack/webpack#22761))

- Keep globals a `globalThis` write replaces, and `slice` on a patched array. (by [@&#8203;alexander-akait](https://github.com/alexander-akait) in [#&#8203;22862](webpack/webpack#22862))

- Skip HTML script tags for shared chunks that emit no JavaScript. (by [@&#8203;bjohansebas](https://github.com/bjohansebas) in [#&#8203;22779](webpack/webpack#22779))

- Keep the digits Firefox lays out a minified CSS percentage with. (by [@&#8203;alexander-akait](https://github.com/alexander-akait) in [#&#8203;22718](webpack/webpack#22718))

- Reject a second `srcset` descriptor after a `0x` density descriptor. (by [@&#8203;alexander-akait](https://github.com/alexander-akait) in [#&#8203;22741](webpack/webpack#22741))

- Minify JavaScript faster, folding string methods on constants and `x -= 1`. (by [@&#8203;alexander-akait](https://github.com/alexander-akait) in [#&#8203;22823](webpack/webpack#22823))

- Shorten minified JavaScript, and keep it running like its source. (by [@&#8203;alexander-akait](https://github.com/alexander-akait) in [#&#8203;22717](webpack/webpack#22717))

- Drop more unused functions, arguments, calls, global reads and variable copies when minifying JavaScript. (by [@&#8203;alexander-akait](https://github.com/alexander-akait) in [#&#8203;22789](webpack/webpack#22789))

- Minify JavaScript smaller where swc does, and fold a function's `length` right. (by [@&#8203;alexander-akait](https://github.com/alexander-akait) in [#&#8203;22826](webpack/webpack#22826))

- Reduce JavaScript output size where oxc or swc produce smaller output. (by [@&#8203;alexander-akait](https://github.com/alexander-akait) in [#&#8203;22829](webpack/webpack#22829))

- Update watchpack to 2.6.3 and rebuild on a `node_modules` created mid-build. (by [@&#8203;alexander-akait](https://github.com/alexander-akait) in [#&#8203;22743](webpack/webpack#22743))

- Support `concatenateModules` with `cacheUnaffected`. (by [@&#8203;alexander-akait](https://github.com/alexander-akait) in [#&#8203;22746](webpack/webpack#22746))

- Update schema-utils to 4.8.1. (by [@&#8203;alexander-akait](https://github.com/alexander-akait) in [#&#8203;22774](webpack/webpack#22774))

- Keep CSS fallbacks, vendor overrides, `oklch()` hues and HTML elements. (by [@&#8203;alexander-akait](https://github.com/alexander-akait) in [#&#8203;22753](webpack/webpack#22753))

- Validate `CleanPlugin` and `DotenvPlugin` options with a precompiled check, so valid options no longer compile their schema at startup. (by [@&#8203;alexander-akait](https://github.com/alexander-akait) in [#&#8203;22758](webpack/webpack#22758))

- Speed up startup and CSS minification, sharing the compile cache with workers. (by [@&#8203;xiaoxiaojx](https://github.com/xiaoxiaojx) in [#&#8203;22706](webpack/webpack#22706))

- Use precise, generic types for modules, parsers, generators, stats and loaders. (by [@&#8203;alexander-akait](https://github.com/alexander-akait) in [#&#8203;22731](webpack/webpack#22731))

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - "before 9am on tuesday"
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xNzUuMSIsInVwZGF0ZWRJblZlciI6IjQ0LjE3NS4xIiwidGFyZ2V0QnJhbmNoIjoiZGV2ZWxvcCIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiLCJyZW5vdmF0ZSJdfQ==-->

Reviewed-on: https://code.futo.org/harbor/harbor/pulls/2035
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build-perf Build time and memory of webpack itself area: sourcemaps devtool and source map generation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants