Skip to content

fix(cjs): flag exports used through a CommonJS namespace re-export - #22791

Merged
alexander-akait merged 3 commits into
mainfrom
fix/cjs-namespace-reexport-self-reference
Oct 19, 2026
Merged

alexander-akait merged 3 commits into
mainfrom
fix/cjs-namespace-reexport-self-reference

Conversation

@alexander-akait

@alexander-akait alexander-akait commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Summary

Fixes #22788, a 5.112.0 regression from #22276.

For exports.Sig = require("./sig") where sig sets __esModule, the re-export's nested exports info now owns __esModule and redirects everything else to sig's exports. When FlagDependencyUsagePlugin marked Sig.wrap used through that redirect, it looked up the owning module of the redirecting exports info, found none, and never queued sig. So sig's self-references (exports.magicBytes inside wrap()) and its own requires stayed unused, and code generation threw.

The lookup now follows the redirect for names the nested exports info doesn't own:

// before
: exportInfoToModuleMap.get(currentExportsInfo);
// after
: getExportOwnerModule(currentExportsInfo, usedExport[i]);

Before/after on require("viem").parseEther("1") (viem 2.57.7, production, the issue's graph):

Result
before 5 errors: Self-reference dependency has unused export name: This should not happen (@scure/base, @scure/bip32, ox/_cjs/…)
after 0 errors; bundle prints 1000000000000000000n

What kind of change does this PR introduce?

fix

Did you add tests for your changes?

Yes: test/configCases/cjs-tree-shaking/reexport-namespace-self-reference/ (fails before the fix with the same error).

Does this PR introduce a breaking change?

No

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

n/a

Use of AI

Claude Code reproduced the issue against the real viem graph, traced the root cause, wrote the fix and the regression test, and drafted this description; reviewed by the author.


Generated by Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue where CommonJS namespace re-exports could incorrectly report an unused export when a module referenced its own exports.

A namespace re-export's nested exports info redirects to the required
module's exports, so marking an export used through it never queued that
module, leaving its self-references unused.

Fixes #22788
@coderabbitai

coderabbitai Bot commented Oct 19, 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: 42975c26-199a-4b03-b909-284d3b84c6d7
📥 Commits

Reviewing files that changed from the base of the PR and between 0e3060d and d71943a.

📒 Files selected for processing: 1
  • test/configCases/cjs-tree-shaking/reexport-namespace-self-reference/webpack.config.js
📝 Walkthrough

Nested-export usage now resolves the module that owns the requested export by following the exports-info redirect chain. A configuration test covers direct, nested, and side-effectful CommonJS namespace re-exports, including the __esModule marker.

Changes: CommonJS export ownership

Layer / File(s) Summary
Resolve nested export owners
lib/optimize/FlagDependencyUsagePlugin.js, .changeset/060-cjs-namespace-reexport-self-reference.md
The plugin follows the exports-info redirect chain to find the owner of a requested nested export. Both nested-export usage paths use this lookup. The changeset records a patch for webpack.
Exercise namespace re-exports
test/configCases/cjs-tree-shaking/reexport-namespace-self-reference/*
The test fixture checks Signature.wrap through direct, nested, and side-effectful namespace re-exports. It also checks the __esModule marker and configures .cjs side-effect handling.

Possibly related PRs

  • webpack/webpack#21651: Changes whether CommonJS re-exports remain active based on parent export usage and target module side effects.
  • webpack/webpack#22276: Adds CommonJS namespace re-export analysis and records export chains used by the module graph.

Suggested labels: regression

Priority: ⬆️ High

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to d7194

The change addresses CommonJS namespace re-export self-references and adds regression assertions for direct, nested, and effectful cases. No merge-blocking risk is evident in the reviewed changes.

Pre-merge checks: Passed 4
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title uses the required Conventional Commit form with the allowed type fix and optional scope cjs. It accurately describes the CommonJS namespace re-export fix.
Linked Issues check Passed The PR satisfies the coding requirements in #22788. FlagDependencyUsagePlugin follows the ExportsInfo redirect when the nested info does not own the requested export, then finds the owning module.…
Out of Scope Changes check Passed The changed files stay within #22788. The implementation fixes CommonJS export-owner lookup, the config case provides regression coverage, and the changeset documents the same fix. No unrelated change…
Full details: Linked Issues check

Explanation

The PR satisfies the coding requirements in #22788. FlagDependencyUsagePlugin follows the ExportsInfo redirect when the nested info does not own the requested export, then finds the owning module. The regression test covers direct and nested CommonJS namespace re-exports, self-references, side effects, and __esModule handling.

Full details: Out of Scope Changes check

Explanation

The changed files stay within #22788. The implementation fixes CommonJS export-owner lookup, the config case provides regression coverage, and the changeset documents the same fix. No unrelated change is shown.

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

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Types Coverage

Coverage after merging fix/cjs-namespace-reexport-self-reference into main will be
99.28%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
bin
   webpack.js98.86%100%100%98.86%113
declarations
   WebpackOptions.ts99.94%100%100%99.94%4240
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%1783, 2096, 2103, 2111, 2133, 2136, 3124, 3675, 3718, 4307, 4311, 4438, 4459, 4584, 4621, 4628, 4681–4682, 4686, 4691, 4707–4708, 4722–4723, 4728–4729, 5257, 5283, 6113, 6130, 6148, 6164, 6179, 6204, 6207, 6575, 6578–6579, 6584, 6599, 6682, 6706, 855–856
   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.js100%100%100%100%
   cssMinify.js100%100%100%100%
   data.js99.84%100%100%99.84%229, 5601
   syntax-parser.js99.69%100%100%99.69%10798–10799, 11351–11352, 11389, 11599, 11648, 13966, 14027–14030, 14135–14136, 14234–14235, 14983, 15280, 15282, 15802, 16168, 18311, 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.js100%100%100%100%
lib/define
   DefinePlugin.js99.42%100%100%99.42%1488, 936, 938, 943, 967
   DotenvPlugin.js97.62%100%100%97.62%276, 395, 443, 456–457
   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
   CommonJsDependencyHelpers.js98.63%100%100%98.63%43
   CommonJsExportRequireDependency.js99.21%100%100%99.21%414, 416, 418
   

@github-actions github-actions Bot added the area: optimization Tree-shaking, splitChunks, concatenation, ids (lib/optimize, lib/ids) label Oct 19, 2026
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

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

Install it locally:

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

@coderabbitai coderabbitai Bot added the regression Worked in a previous release; pair with the Affected version field label Oct 19, 2026
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Generated code size

Comparing base (701dab6) to head (d71943a). Merging this pull request adds 1 new asset(s).

What moved Tests Assets Gzip Raw Test edit
Changed, test untouched 0 0 — — —
Changed, test edited 0 0 — — —
New 1 1 ⚪ added +848 B ⚪ added +3.83 KiB —
Deleted 0 0 — — —
Unchanged — 9045 — — —

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.

1 asset(s) this pull request adds
Asset Raw Gzip (9) Brotli (11) Zstd (19)
⚪ added cjs-tree-shaking/reexport-namespace-self-reference bundle0.js 3.83 KiB 848 B 755 B 849 B

No runtime gained or lost a runtime module.

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

@codspeed

codspeed Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Merging this PR will degrade performance by 50.24%

⚠️ 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

⚡ 1 improved benchmark
❌ 2 regressed benchmarks
✅ 409 untouched benchmarks
⏩ 212 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Memory unit benchmark "css-parser-tailwind-unit", process (expanded, no visitors) 30.8 KB 232 KB -86.72%
❌ Memory unit benchmark "js-parser-unit", sourceType 'module' 634.8 KB 964.7 KB -34.2%
⚡ Memory unit benchmark "html-parser-document-unit", parseHtml 459.4 KB 325.9 KB +40.97%

Tip

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


Comparing fix/cjs-namespace-reexport-self-reference (d71943a) with main (701dab6)

Open in CodSpeed

Footnotes

  1. 212 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. ↩

Both failed with "Self-reference dependency has unused export name" before
the fix; run the case with and without module concatenation.
@changeset-bot

changeset-bot Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d71943a

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

…case

CommonJS modules concatenate only with `concatenateModules.commonjs` from
an ESM root, so both variants emitted identical bundles.
@codecov

codecov Bot commented Oct 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.50%. Comparing base (701dab6) to head (d71943a).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #22791      +/-   ##
==========================================
- Coverage   96.50%   96.50%   -0.01%     
==========================================
  Files         778      778              
  Lines      137816   137823       +7     
  Branches    46836    46838       +2     
==========================================
+ Hits       133003   133009       +6     
- Misses       4813     4814       +1     
Flag Coverage Δ
css-parsing 24.77% <11.11%> (-0.01%) ⬇️
html5lib 26.55% <11.11%> (-0.01%) ⬇️
integration 81.28% <100.00%> (+<0.01%) ⬆️
minify-corpora 90.94% <ø> (ø)
syntax-equivalence 78.79% <ø> (ø)
test262 55.86% <66.66%> (+<0.01%) ⬆️
test262-parser 79.42% <ø> (ø)
unit 76.65% <11.11%> (-0.01%) ⬇️
xmlconf 27.51% <ø> (ø)

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.

@alexander-akait
alexander-akait merged commit b90cb59 into main Oct 19, 2026
69 checks passed
@alexander-akait
alexander-akait deleted the fix/cjs-namespace-reexport-self-reference branch October 19, 2026 13:41
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: optimization Tree-shaking, splitChunks, concatenation, ids (lib/optimize, lib/ids) regression Worked in a previous release; pair with the Affected version field

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression in 5.112.0: Self-reference dependency has unused export name for CommonJS modules

1 participant