GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(esm): bake templated public paths and hashed wasm names into analyzable output by alexander-akait · Pull Request #21669 · webpack/webpack

Conversation

@alexander-akait

@alexander-akait alexander-akait commented Aug 10, 2026 •
edited by coderabbitai Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Summary

Three shapes that used to fall back to the runtime chunk loader are now baked into a literal a foreign bundler can follow: a [fullhash] in output.webassemblyModuleFilename, a templated output.publicPath / output.workerPublicPath, and a build where some other entry reassigns __webpack_public_path__ (that switch was compilation-wide, but __webpack_require__.p belongs to a runtime). Deferring a name no longer requires optimization.realContentHash when no emitted javascript is named by its content — with [name].js there is nothing to go stale — so those names bake in a plain development build too.

Two bugs found on the way are fixed here as well. A [fullhash:<digest>] wasm name lost its hash segment entirely at runtime, so the loader fetched a path no emitted file had and every wasm module in such a build failed to load; it reproduces identically on main. And the deferred substitution ran at PROCESS_ASSETS_STAGE_OPTIMIZE_HASH - 1, after source maps are written and after a minifier runs — a stand-in and the name replacing it are different lengths, so mappings after it shifted (measured at 16 columns on a minified line, where the whole bundle is one line). Refs #17121

What kind of change does this PR introduce?

feat

Did you add tests for your changes?

Yes. New: configCases/analyzable/{templated-public-path,templated-worker-public-path,deferred-before-source-maps,public-path-override-scope,block-without-origin} and configCases/wasm/{analyzable-fullhash-filename,full-hash-digest-filename}. Updated: statsCases/analyzable-esm-fallbacks. Each case was confirmed to fail without its change.

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?

That output.publicPath, output.workerPublicPath and output.webassemblyModuleFilename may now carry [fullhash] in an analyzable ESM build. Two limitations are worth stating: a [fullhash:<digest>] cannot be baked (a stand-in cannot survive re-encoding), and a hashed chunk name still needs optimization.realContentHash, because the referencing chunk's hash would have to depend on the referenced chunk's.

Use of AI

Yes — written with Claude Code. It traced the fallback paths, implemented the changes and wrote the test cases, and produced the evidence cited above: before/after builds compared against the emitted assets, a source-map alignment measurement, and branch-reachability probes run over the full test suite to tell a dead guard from an untested one. I reviewed every change and every measurement before committing.


Generated by Claude Code

Summary by CodeRabbit

  • New Features

    • Improved analyzable module imports, workers, worklets, and WebAssembly URLs.
    • Added support for templated public paths and hashed WebAssembly filenames, including truncated and digest-based hashes.
    • Preserved runtime loading when public paths are overridden or output cannot be safely analyzed.
  • Bug Fixes

    • Improved source-map alignment when deferred URLs are resolved.
    • Ensured generated chunk and WebAssembly filenames use consistent hash handling.
  • Tests

    • Added coverage for public-path overrides, workers, dynamic imports, source maps, and WebAssembly loading scenarios.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@changeset-bot

changeset-bot Bot commented Aug 10, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 424df4a

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

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

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@alexander-akait, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 20 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 5c7aa3a6-d8b4-4042-ae5f-87a8bded4a46

📥 Commits

Reviewing files that changed from the base of the PR and between 287a4a3 and 424df4a.

⛔ Files ignored due to path filters (2)
  • test/statsCases/output-module/__snapshots__/StatsTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • types.d.ts is excluded by !types.d.ts
📒 Files selected for processing (25)
  • .changeset/022-analyzable-public-path-and-wasm-names.md
  • lib/APIPlugin.js
  • lib/RuntimeTemplate.js
  • lib/TemplatedPathPlugin.js
  • lib/dependencies/URLDependency.js
  • lib/esm/AnalyzableChunkHashPlugin.js
  • lib/optimize/ConcatenatedModule.js
  • lib/wasm-async/AsyncWebAssemblyModulesPlugin.js
  • lib/wasm/wasmModuleFilename.js
  • test/configCases/analyzable/concatenated-origin/helper.js
  • test/configCases/analyzable/concatenated-origin/index.js
  • test/configCases/analyzable/concatenated-origin/overriding-lazy.js
  • test/configCases/analyzable/concatenated-origin/overriding.js
  • test/configCases/analyzable/concatenated-origin/plain-lazy.js
  • test/configCases/analyzable/concatenated-origin/plain.js
  • test/configCases/analyzable/concatenated-origin/webpack.config.js
  • test/configCases/analyzable/deferred-before-minify/dynamic.js
  • test/configCases/analyzable/deferred-before-minify/index.js
  • test/configCases/analyzable/deferred-before-minify/roundTrip.js
  • test/configCases/analyzable/deferred-before-minify/webpack.config.js
  • test/configCases/analyzable/deferred-before-source-maps/index.js
  • test/configCases/analyzable/deferred-before-source-maps/webpack.config.js
  • test/configCases/wasm/analyzable-fullhash-filename/webpack.config.js
  • test/configCases/wasm/full-hash-digest-filename/webpack.config.js
  • test/statsCases/analyzable-esm-fallbacks/webpack.config.js

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key: "tools"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
📝 Walkthrough

Walkthrough

Changes

The PR adds module-scoped public-path override tracking and context-aware analyzable ESM, worker, worklet, dynamic-import, and WebAssembly checks. It also defers safe full-hash substitutions for public paths, chunk specifiers, source maps, and WebAssembly filenames.

Analyzable output and hash resolution

Layer / File(s) Summary
Context-aware analyzability
lib/APIPlugin.js, lib/RuntimeTemplate.js, lib/dependencies/*, lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js, test/configCases/analyzable/block-without-origin/*, test/configCases/analyzable/public-path-override-scope/*, test/configCases/analyzable/templated-worker-public-path/*
Public-path overrides are tracked per module and runtime. Analyzability checks receive chunk-graph and module context. Tests cover origin-less blocks, scoped overrides, and worker output.
Deferred hash substitution
lib/TemplatedPathPlugin.js, lib/RuntimePlugin.js, lib/esm/AnalyzableChunkHashPlugin.js, lib/RuntimeTemplate.js, test/configCases/analyzable/deferred-before-source-maps/*, test/configCases/analyzable/templated-public-path/*, test/statsCases/analyzable-esm-fallbacks/*
Safe full-hash and chunk-specifier placeholders are resolved during derived asset processing. Replacements use ReplaceSource, and tests verify generated paths and source-map alignment.
WebAssembly full-hash runtime handling
lib/wasm/*, lib/wasm-async/*, lib/wasm-sync/*, lib/node/*WasmPlugin.js, lib/web/*WasmPlugin.js, test/configCases/wasm/*
WebAssembly filename helpers distinguish runtime hash access from digest encoding. Sync and async runtime modules receive digest settings and use deferred compilation hash data. Tests cover analyzable, synchronous, asynchronous, source-phase, and digest filenames.

Possibly related PRs

  • webpack/webpack#21652: Both PRs modify RuntimeTemplate runtime public-path and deferred-import logic.
  • webpack/webpack#21653: Both PRs modify analyzable ESM handling, deferred hashed filenames, and WebAssembly plugins.

Suggested labels: area: sourcemaps

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
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, an allowed type and scope, and accurately describes the main changes.
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.

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Aug 10, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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

Install it locally:

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added area: wasm WebAssembly modules (lib/wasm-*) area: parser JavaScript parsing and dependency analysis (lib/javascript, lib/dependencies) area: runtime Emitted runtime and chunk loading across targets (lib/runtime, lib/web, lib/node, lib/esm) area: types types.d.ts, JSDoc annotations, hand-maintained declarations labels Aug 10, 2026
@codecov

codecov Bot commented Aug 10, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.53%. Comparing base (2d8678a) to head (424df4a).

Additional details and impacted files
@@           Coverage Diff            @@
##             main   #21669    +/-   ##
========================================
  Coverage   94.52%   94.53%            
========================================
  Files         630      631     +1     
  Lines       82008    82147   +139     
  Branches    24272    24320    +48     
========================================
+ Hits        77520    77655   +135     
- Misses       4488     4492     +4     
Flag Coverage Δ
css-parsing 26.62% <23.68%> (+0.03%) ⬆️
html5lib 31.01% <23.68%> (+0.01%) ⬆️
integration 88.35% <100.00%> (+0.01%) ⬆️
test262 51.74% <40.30%> (-0.04%) ⬇️
unit 54.46% <23.68%> (-0.05%) ⬇️

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.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Aug 10, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Generated code size

Comparing 424df4a merged into 2d8678a against 2d8678a. Merging this PR will change the code webpack generates.

Changed New Deleted Unchanged Raw change
Cases 9 11 0 1545 🔴 ↑ +261.34 KiB
Assets 16 64 0 6026 🔴 ↑ +261.34 KiB
Runtimes 7 26 2 1889 —
80 asset(s) changed size, biggest 20 by raw change
Asset Before After Change Gzip (9) Brotli (11) Zstd (19)
➕ wasm/analyzable-fullhash-filename 3/bundle3.mjs — 12.60 KiB +12.60 KiB (new) new new new
➕ wasm/analyzable-fullhash-filename 1/bundle1.mjs — 12.22 KiB +12.22 KiB (new) new new new
➕ wasm/analyzable-fullhash-filename 0/bundle0.mjs — 12.22 KiB +12.22 KiB (new) new new new
➕ wasm/full-hash-digest-filename 1/bundle1.mjs — 12.17 KiB +12.17 KiB (new) new new new
➕ wasm/full-hash-digest-filename 0/bundle0.mjs — 12.16 KiB +12.16 KiB (new) new new new
➕ wasm/full-hash-digest-filename 2/bundle2.mjs — 12.16 KiB +12.16 KiB (new) new new new
➕ wasm/analyzable-fullhash-filename 2/bundle2.mjs — 11.71 KiB +11.71 KiB (new) new new new
➕ analyzable/deferred-before-minify bundle0.mjs.map — 10.90 KiB +10.90 KiB (new) new new new
➕ wasm/full-hash-digest-source-phase bundle0.js — 10.40 KiB +10.40 KiB (new) new new new
➕ wasm/full-hash-digest-sync bundle0.js — 10.00 KiB +10.00 KiB (new) new new new
➕ analyzable/deferred-before-source-maps bundle0.mjs — 9.14 KiB +9.14 KiB (new) new new new
➕ analyzable/templated-public-path 5/bundle5.mjs — 8.45 KiB +8.45 KiB (new) new new new
➕ analyzable/templated-public-path 3/bundle3.mjs — 8.41 KiB +8.41 KiB (new) new new new
➕ analyzable/deferred-before-source-maps bundle0.mjs.map — 8.35 KiB +8.35 KiB (new) new new new
➕ analyzable/templated-public-path 2/bundle2.mjs — 8.11 KiB +8.11 KiB (new) new new new
➕ analyzable/templated-public-path 4/bundle4.mjs — 8.10 KiB +8.10 KiB (new) new new new
➕ analyzable/templated-public-path 0/bundle0.mjs — 8.09 KiB +8.09 KiB (new) new new new
➕ analyzable/templated-public-path 1/bundle1.mjs — 8.09 KiB +8.09 KiB (new) new new new
➕ analyzable/concatenated-origin overriding.mjs — 7.93 KiB +7.93 KiB (new) new new new
➕ analyzable/public-path-override-scope overriding.mjs — 7.72 KiB +7.72 KiB (new) new new new
… 60 more asset(s), see the uploaded report
35 runtime(s) changed which runtime modules they carry, biggest 20 by number moved
Runtime Modules Added Removed
➕ wasm/analyzable-fullhash-filename 3/main 0 → 9 async module, define property getters, ensure chunk, get javascript chunk filename, getFullHash, hasOwnProperty shorthand, import chunk loading, make namespace object, wasm loading —
➕ wasm/full-hash-digest-filename 2/main 0 → 9 async module, define property getters, ensure chunk, get javascript chunk filename, getFullHash, hasOwnProperty shorthand, import chunk loading, make namespace object, wasm loading —
➕ wasm/full-hash-digest-filename 0/main 0 → 8 async module, define property getters, ensure chunk, get javascript chunk filename, hasOwnProperty shorthand, import chunk loading, make namespace object, wasm loading —
➕ wasm/full-hash-digest-filename 1/main 0 → 8 async module, define property getters, ensure chunk, get javascript chunk filename, hasOwnProperty shorthand, import chunk loading, make namespace object, wasm loading —
➕ wasm/full-hash-digest-source-phase main 0 → 8 async module, define property getters, ensure chunk, get javascript chunk filename, hasOwnProperty shorthand, make namespace object, require chunk loading, wasm compile —
➕ analyzable/concatenated-origin overriding 0 → 7 define property getters, ensure chunk, get javascript chunk filename, hasOwnProperty shorthand, import chunk loading, make namespace object, publicPath —
➕ analyzable/public-path-override-scope overriding 0 → 7 define property getters, ensure chunk, get javascript chunk filename, hasOwnProperty shorthand, import chunk loading, make namespace object, publicPath —
➕ analyzable/templated-public-path 3/main 0 → 7 define property getters, ensure chunk, get javascript chunk filename, hasOwnProperty shorthand, import chunk loading, make namespace object, publicPath —
➕ analyzable/templated-public-path 5/main 0 → 7 define property getters, ensure chunk, get javascript chunk filename, hasOwnProperty shorthand, import chunk loading, make namespace object, publicPath —
➕ wasm/analyzable-fullhash-filename 0/main 0 → 7 async module, define property getters, ensure chunk, hasOwnProperty shorthand, import chunk loading, make namespace object, wasm loading —
➕ wasm/analyzable-fullhash-filename 1/main 0 → 7 async module, define property getters, ensure chunk, hasOwnProperty shorthand, import chunk loading, make namespace object, wasm loading —
➕ wasm/analyzable-fullhash-filename 2/main 0 → 7 async module, define property getters, ensure chunk, hasOwnProperty shorthand, import chunk loading, make namespace object, wasm loading —
➕ wasm/full-hash-digest-sync main 0 → 7 define property getters, ensure chunk, get javascript chunk filename, hasOwnProperty shorthand, make namespace object, require chunk loading, wasm chunk loading —
➕ analyzable/block-without-origin main 0 → 4 ensure chunk, get javascript chunk filename, hasOwnProperty shorthand, import chunk loading —
➕ analyzable/concatenated-origin bundle0 0 → 4 define property getters, hasOwnProperty shorthand, import chunk loading, make namespace object —
➕ analyzable/concatenated-origin plain 0 → 4 define property getters, hasOwnProperty shorthand, import chunk loading, make namespace object —
➕ analyzable/deferred-before-minify main 0 → 4 define property getters, hasOwnProperty shorthand, import chunk loading, make namespace object —
➕ analyzable/deferred-before-source-maps main 0 → 4 define property getters, hasOwnProperty shorthand, import chunk loading, make namespace object —
➕ analyzable/public-path-override-scope plain 0 → 4 define property getters, hasOwnProperty shorthand, import chunk loading, make namespace object —
➕ analyzable/templated-public-path 0/main 0 → 4 define property getters, hasOwnProperty shorthand, import chunk loading, make namespace object —
… 15 more runtime(s), see the uploaded report

Built test/configCases with the defaults a user gets: 1565 case(s), 6106 asset(s), 40 emitted nothing.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@codspeed

codspeed Bot commented Aug 10, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Merging this PR will regress 4 benchmarks

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

⚡ 8 improved benchmarks
❌ 4 regressed benchmarks
✅ 298 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Memory benchmark "asset-modules-bytes", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' 790.7 KB 1,150.9 KB -31.3%
❌ Memory benchmark "many-chunks-commonjs", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' 435 KB 577 KB -24.61%
❌ Memory benchmark "asset-modules-resource", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' 654.5 KB 839.5 KB -22.04%
❌ Memory benchmark "future-defaults", scenario '{"name":"mode-development","mode":"development"}' 818 KB 1,026.3 KB -20.3%
⚡ Memory benchmark "asset-modules-inline", scenario '{"name":"mode-development","mode":"development"}' 1.9 MB 1.3 MB +42.69%
⚡ Memory benchmark "asset-modules-resource", scenario '{"name":"mode-development","mode":"development"}' 31.5 MB 22.8 MB +38.05%
⚡ Memory benchmark "devtool-eval-source-map", scenario '{"name":"mode-development","mode":"development"}' 14.2 MB 10.4 MB +36.05%
⚡ Memory benchmark "asset-modules-bytes", scenario '{"name":"mode-development","mode":"development"}' 6.4 MB 4.7 MB +35.45%
⚡ Memory benchmark "cache-filesystem", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' 1,156.5 KB 862 KB +34.17%
⚡ Memory benchmark "css-modules", scenario '{"name":"mode-development","mode":"development"}' 12.7 MB 9.8 MB +29.79%
⚡ Memory benchmark "three-long", scenario '{"name":"mode-development","mode":"development"}' 14.4 MB 11.2 MB +28.65%
⚡ Memory benchmark "asset-modules-source", scenario '{"name":"mode-development","mode":"development"}' 7 MB 5.5 MB +27.93%

Tip

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


Comparing feat/analyzable-public-path-override-scope (424df4a) with main (2d8678a)

Open in CodSpeed
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coderabbitai coderabbitai Bot added the area: sourcemaps devtool and source map generation label Aug 10, 2026
coderabbitai[bot]
coderabbitai Bot reviewed Aug 10, 2026
View reviewed changes

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (3)
lib/wasm/wasmModuleFilename.js (1)

18-20: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Keep new explanatory comments to two short lines.

  • lib/wasm/wasmModuleFilename.js#L18-L20: shorten the needsRuntimeFullHash comment.
  • test/configCases/wasm/analyzable-fullhash-filename/webpack.config.js#L58-L65: shorten both explanatory comments.
  • test/configCases/wasm/full-hash-digest-filename/webpack.config.js#L3-L5: shorten the digest interpolation comment.
  • test/configCases/wasm/full-hash-digest-filename/webpack.config.js#L47-L49: shorten the plain full-hash comment.

As per coding guidelines, comments must generally be no more than two short lines.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/wasm/wasmModuleFilename.js` around lines 18 - 20, Shorten the explanatory
comments at lib/wasm/wasmModuleFilename.js:18-20 near needsRuntimeFullHash, both
comments at
test/configCases/wasm/analyzable-fullhash-filename/webpack.config.js:58-65, the
digest interpolation comment at
test/configCases/wasm/full-hash-digest-filename/webpack.config.js:3-5, and the
plain full-hash comment at
test/configCases/wasm/full-hash-digest-filename/webpack.config.js:47-49 so each
is no more than two short lines while preserving the relevant explanation.

Source: Coding guidelines

lib/TemplatedPathPlugin.js (1)

78-81: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Keep the lib/ comment within the two-line limit.

Lines 78-81 use four comment lines. Compress the explanation to two short lines.

Suggested replacement
-// `[fullhash:<digest>]`/`[hash:<digest>]` — a non-numeric first argument is a digest
-// (a numeric one is just a length). A digest re-encodes the hash rather than reading
-// it, so no stand-in or runtime expression can take its place: the settled value has
-// to be inlined instead.
+// `[fullhash:<digest>]`/`[hash:<digest>]`: non-numeric args request digest re-encoding;
+// numeric args are lengths, so digest values must be inlined after hash settlement.

As per coding guidelines, comments in {lib,hot,tooling,test}/**/*.{js,mjs} must be no more than two short lines.
As per path instructions, comments in lib/** must be at most two short lines.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/TemplatedPathPlugin.js` around lines 78 - 81, Compress the explanatory
comment in TemplatedPathPlugin.js describing non-numeric digest arguments and
inlining settled hash values from four lines to no more than two short lines,
preserving the same meaning.

Sources: Coding guidelines, Path instructions

lib/esm/AnalyzableChunkHashPlugin.js (1)

21-23: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Reduce the new block comments to two short lines.

Keep only information that the code does not express.

  • lib/esm/AnalyzableChunkHashPlugin.js#L21-L23: shorten the token-format comment.
  • lib/esm/AnalyzableChunkHashPlugin.js#L46-L48: shorten the deferred-path-data comment.
  • lib/esm/AnalyzableChunkHashPlugin.js#L99-L103: shorten the class-purpose comment.
  • lib/esm/AnalyzableChunkHashPlugin.js#L118-L122: shorten the asset-stage comment.
  • lib/esm/AnalyzableChunkHashPlugin.js#L175-L176: reduce the comment that begins on line 174.
  • lib/esm/AnalyzableChunkHashPlugin.js#L192-L194: shorten the ReplaceSource comment.
  • test/configCases/analyzable/deferred-before-source-maps/webpack.config.js#L3-L5: shorten the source-map ordering comment.
  • test/statsCases/analyzable-esm-fallbacks/webpack.config.js#L59-L61: shorten the fallback-condition comment.

As per coding guidelines, comments must be short and generally no more than two short lines. As per path instructions, comments must be at most two short lines and add non-obvious information.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/esm/AnalyzableChunkHashPlugin.js` around lines 21 - 23, Shorten the
comments at lib/esm/AnalyzableChunkHashPlugin.js lines 21-23, 46-48, 99-103,
118-122, 175-176, and 192-194 to no more than two short lines each, retaining
only non-obvious information. Also shorten the comments at
test/configCases/analyzable/deferred-before-source-maps/webpack.config.js lines
3-5 and test/statsCases/analyzable-esm-fallbacks/webpack.config.js lines 59-61
to the same two-line limit, without changing code behavior.

Sources: Coding guidelines, Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.changeset/021-analyzable-import-coverage.md:
- Line 5: Use .changeset/021-analyzable-import-coverage.md as the single minor
changeset: retain its feature-level release note and merge in the source-map
behavior from .changeset/023-analyzable-substitution-source-maps.md#L5-L5.
Delete .changeset/023-analyzable-substitution-source-maps.md after merging its
note.

In `@lib/wasm-async/AsyncWebAssemblyModulesPlugin.js`:
- Around line 82-84: Shorten the comment above AnalyzableChunkHashPlugin to two
short lines while preserving the reason it must be applied: binary names may
contain a compilation hash placeholder that this pass fills during chunk
loading, and applying it twice is harmless.

In `@test/configCases/analyzable/deferred-before-source-maps/index.js`:
- Around line 20-27: Extend the source-map assertions in the
deferred-before-source-maps test after the existing line-count checks: decode
map.mappings and assert that a generated position following the substituted
specifier resolves to the expected location in index.js. Use explicit expect()
assertions for the decoded source, original line, and column so stale generated
columns are detected, and add a snapshot of the generated output as requested.

---

Nitpick comments:
In `@lib/esm/AnalyzableChunkHashPlugin.js`:
- Around line 21-23: Shorten the comments at
lib/esm/AnalyzableChunkHashPlugin.js lines 21-23, 46-48, 99-103, 118-122,
175-176, and 192-194 to no more than two short lines each, retaining only
non-obvious information. Also shorten the comments at
test/configCases/analyzable/deferred-before-source-maps/webpack.config.js lines
3-5 and test/statsCases/analyzable-esm-fallbacks/webpack.config.js lines 59-61
to the same two-line limit, without changing code behavior.

In `@lib/TemplatedPathPlugin.js`:
- Around line 78-81: Compress the explanatory comment in TemplatedPathPlugin.js
describing non-numeric digest arguments and inlining settled hash values from
four lines to no more than two short lines, preserving the same meaning.

In `@lib/wasm/wasmModuleFilename.js`:
- Around line 18-20: Shorten the explanatory comments at
lib/wasm/wasmModuleFilename.js:18-20 near needsRuntimeFullHash, both comments at
test/configCases/wasm/analyzable-fullhash-filename/webpack.config.js:58-65, the
digest interpolation comment at
test/configCases/wasm/full-hash-digest-filename/webpack.config.js:3-5, and the
plain full-hash comment at
test/configCases/wasm/full-hash-digest-filename/webpack.config.js:47-49 so each
is no more than two short lines while preserving the relevant explanation.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b757d220-af94-4e14-8656-b1e54d9d6309

📥 Commits

Reviewing files that changed from the base of the PR and between 78d0d4c and 71efde3.

⛔ Files ignored due to path filters (2)
  • test/statsCases/analyzable-esm-fallbacks/__snapshots__/StatsTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • types.d.ts is excluded by !types.d.ts
📒 Files selected for processing (62)
  • .changeset/021-analyzable-import-coverage.md
  • .changeset/022-wasm-full-hash-digest-filename.md
  • .changeset/023-analyzable-substitution-source-maps.md
  • lib/APIPlugin.js
  • lib/RuntimePlugin.js
  • lib/RuntimeTemplate.js
  • lib/TemplatedPathPlugin.js
  • lib/dependencies/URLDependency.js
  • lib/dependencies/WorkerDependency.js
  • lib/dependencies/WorkletDependency.js
  • lib/esm/AnalyzableChunkHashPlugin.js
  • lib/node/ReadFileCompileAsyncWasmPlugin.js
  • lib/node/ReadFileCompileWasmPlugin.js
  • lib/wasm-async/AsyncWasmCompileRuntimeModule.js
  • lib/wasm-async/AsyncWasmLoadingRuntimeModule.js
  • lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js
  • lib/wasm-async/AsyncWebAssemblyModulesPlugin.js
  • lib/wasm-async/UniversalCompileAsyncWasmPlugin.js
  • lib/wasm-sync/WasmChunkLoadingRuntimeModule.js
  • lib/wasm/wasmModuleFilename.js
  • lib/web/FetchCompileAsyncWasmPlugin.js
  • lib/web/FetchCompileWasmPlugin.js
  • test/configCases/analyzable/block-without-origin/index.js
  • test/configCases/analyzable/block-without-origin/lazy.js
  • test/configCases/analyzable/block-without-origin/test.filter.js
  • test/configCases/analyzable/block-without-origin/webpack.config.js
  • test/configCases/analyzable/deferred-before-source-maps/dynamic.js
  • test/configCases/analyzable/deferred-before-source-maps/index.js
  • test/configCases/analyzable/deferred-before-source-maps/webpack.config.js
  • test/configCases/analyzable/public-path-override-scope/index.js
  • test/configCases/analyzable/public-path-override-scope/overriding-lazy.js
  • test/configCases/analyzable/public-path-override-scope/overriding.js
  • test/configCases/analyzable/public-path-override-scope/plain-lazy.js
  • test/configCases/analyzable/public-path-override-scope/plain.js
  • test/configCases/analyzable/public-path-override-scope/webpack.config.js
  • test/configCases/analyzable/templated-public-path/dynamic.js
  • test/configCases/analyzable/templated-public-path/index.js
  • test/configCases/analyzable/templated-public-path/webpack.config.js
  • test/configCases/analyzable/templated-worker-public-path/index.js
  • test/configCases/analyzable/templated-worker-public-path/test.config.js
  • test/configCases/analyzable/templated-worker-public-path/test.filter.js
  • test/configCases/analyzable/templated-worker-public-path/webpack.config.js
  • test/configCases/analyzable/templated-worker-public-path/worker.js
  • test/configCases/wasm/analyzable-fullhash-filename/index.js
  • test/configCases/wasm/analyzable-fullhash-filename/module.js
  • test/configCases/wasm/analyzable-fullhash-filename/test.config.js
  • test/configCases/wasm/analyzable-fullhash-filename/wasm.wat
  • test/configCases/wasm/analyzable-fullhash-filename/webpack.config.js
  • test/configCases/wasm/full-hash-digest-filename/index.js
  • test/configCases/wasm/full-hash-digest-filename/module.js
  • test/configCases/wasm/full-hash-digest-filename/wasm.wat
  • test/configCases/wasm/full-hash-digest-filename/webpack.config.js
  • test/configCases/wasm/full-hash-digest-source-phase/index.js
  • test/configCases/wasm/full-hash-digest-source-phase/module.js
  • test/configCases/wasm/full-hash-digest-source-phase/wasm.wat
  • test/configCases/wasm/full-hash-digest-source-phase/webpack.config.js
  • test/configCases/wasm/full-hash-digest-sync/index.js
  • test/configCases/wasm/full-hash-digest-sync/module.js
  • test/configCases/wasm/full-hash-digest-sync/wasm.wat
  • test/configCases/wasm/full-hash-digest-sync/webpack.config.js
  • test/statsCases/analyzable-esm-fallbacks/test.config.js
  • test/statsCases/analyzable-esm-fallbacks/webpack.config.js
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • webpack/schema-utils (auto-detected)
  • webpack/tapable (auto-detected)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread .changeset/021-analyzable-import-coverage.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/wasm-async/AsyncWebAssemblyModulesPlugin.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread test/configCases/analyzable/deferred-before-source-maps/index.js Outdated
Comment on lines +20 to +27
// The name reached the bundle and the file it names reached disk.
expect(specifier).not.toBe(null);
expect(fs.existsSync(path.join(dir, specifier[1].slice(2)))).toBe(true);
// A map generated before substitution would describe a longer file.
expect(map.mappings.length).toBeGreaterThan(0);
expect(code.split("\n").length).toBeGreaterThanOrEqual(
map.mappings.split(";").length - 1
);

@coderabbitai coderabbitai Bot Aug 10, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Assert a resolved source-map position.

The line-count check cannot detect stale generated columns. Full-hash substitution changes columns without changing line count. Decode the map and assert that a generated position after the substituted specifier resolves to the expected original index.js position.

As per coding guidelines, snapshot generated output and use explicit assertions for behavior and invariants. As per path instructions, use explicit expect() assertions for behavior.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/configCases/analyzable/deferred-before-source-maps/index.js` around
lines 20 - 27, Extend the source-map assertions in the
deferred-before-source-maps test after the existing line-count checks: decode
map.mappings and assert that a generated position following the substituted
specifier resolves to the expected location in index.js. Use explicit expect()
assertions for the decoded source, original line, and column so stale generated
columns are detected, and add a snapshot of the generated output as requested.

Sources: Coding guidelines, Path instructions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
coderabbitai[bot]
coderabbitai Bot reviewed Aug 10, 2026
View reviewed changes

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.changeset/022-analyzable-public-path-and-wasm-names.md:
- Line 5: Shorten the changeset summary in
022-analyzable-public-path-and-wasm-names.md to a concise imperative sentence of
80 characters or fewer, and ensure it ends with a period while preserving the
intended change.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b80aff52-4ab7-4196-a9f3-4604dd8b6141

📥 Commits

Reviewing files that changed from the base of the PR and between 71efde3 and 287a4a3.

📒 Files selected for processing (10)
  • .changeset/022-analyzable-public-path-and-wasm-names.md
  • lib/TemplatedPathPlugin.js
  • lib/esm/AnalyzableChunkHashPlugin.js
  • lib/wasm-async/AsyncWebAssemblyModulesPlugin.js
  • lib/wasm/wasmModuleFilename.js
  • test/configCases/analyzable/deferred-before-source-maps/index.js
  • test/configCases/analyzable/deferred-before-source-maps/webpack.config.js
  • test/configCases/wasm/analyzable-fullhash-filename/webpack.config.js
  • test/configCases/wasm/full-hash-digest-filename/webpack.config.js
  • test/statsCases/analyzable-esm-fallbacks/webpack.config.js
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • webpack/schema-utils (auto-detected)
  • webpack/tapable (auto-detected)
🚧 Files skipped from review as they are similar to previous changes (8)
  • lib/wasm-async/AsyncWebAssemblyModulesPlugin.js
  • lib/TemplatedPathPlugin.js
  • lib/wasm/wasmModuleFilename.js
  • test/configCases/wasm/analyzable-fullhash-filename/webpack.config.js
  • test/configCases/analyzable/deferred-before-source-maps/webpack.config.js
  • test/statsCases/analyzable-esm-fallbacks/webpack.config.js
  • lib/esm/AnalyzableChunkHashPlugin.js
  • test/configCases/wasm/full-hash-digest-filename/webpack.config.js

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread .changeset/022-analyzable-public-path-and-wasm-names.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

@coderabbitai coderabbitai Bot mentioned this pull request Aug 10, 2026
fix: resolve asset urls in build-time executed modules #21672
Merged
alexander-akait added 9 commits August 11, 2026 08:22
@alexander-akait @claude
feat(esm): bake a wasm binary name that carries the compilation hash
4966e7c
`output.webassemblyModuleFilename` with a `[fullhash]` in it was the one
name the analyzable wasm reference could not be built from, because the
compilation hash does not exist during code generation. The call site now
resolves everything it does know and leaves the hash as a stand-in, which
the deferred pass fills in once it is settled — the same mechanism a hashed
chunk specifier already uses, so it carries the same `realContentHash`
requirement.

A `[fullhash:<digest>]` re-encodes the hash rather than reading it, which a
stand-in cannot survive, so that form keeps the runtime path.

Where the url is baked the runtime no longer interpolates the name at all,
so `getFullHash` is no longer pulled into those bundles.
@alexander-akait @claude
feat(esm): bake a templated public path into the analyzable specifier
ef5033a
A `[fullhash]` in `output.publicPath` (or `output.workerPublicPath`) made the
whole specifier unknowable during code generation, so every chunk reference
fell back to the runtime loader. The prefix is now resolved as far as code
generation can, leaving the compilation hash as a stand-in for the deferred
pass — the same `getPath` call `PublicPathRuntimeModule` makes once that hash
exists, so the baked value and the runtime one cannot disagree.

The stand-in a templated public path leaves sits inside the specifier the
chunk pass writes, so the hash pass now runs after it rather than deciding
from the original source whether to run at all. That is what lets a hashed
chunk name and a hashed public path be deferred together.

A `[fullhash:<digest>]` re-encodes the hash rather than reading it, which a
stand-in cannot survive, so that form keeps the runtime path.
@alexander-akait @claude
refactor: gather the analyzable-output rules into three predicates
9a3dfee
The checks deciding whether a reference can be baked had spread across
`RuntimeTemplate`, `AnalyzableChunkHashPlugin` and the call sites, so what
webpack cannot make analyzable was only readable by collecting `if`s from
several files.

They are now three methods on `RuntimeTemplate`, with one doc block above
them naming what each rules out and what none of them cover:

- `supportsAnalyzableEsm` — a `new URL(…, import.meta.url)` literal
- `supportsAnalyzableImport` — an `import("./chunk.js")` literal
- `canDeferAnalyzableName` — a name filled in after the hashes exist

The two forms stay separate on purpose. A literal `import()` survives an
`eval` devtool and `import.meta` does not, so folding them together would
have silently dropped analyzable imports from every default development
build. Deferral keeps two modes for the same reason: a whole name that is
re-resolved later accepts any hash spelling, while one carrying a stand-in
cannot survive a re-encoded digest.

No behaviour change: 30 builds across public paths, hash spellings and
devtools are byte-identical before and after.
@alexander-akait @claude
fix(wasm): build the binary's name from a re-encoded compilation hash
ec1397f
A `[fullhash:<digest>]` in `output.webassemblyModuleFilename` re-encodes the
hash rather than reading it, so the runtime `getFullHash()` expression the
loader interpolates could not stand in for it — re-encoding that expression
as if it were a hash dropped the whole segment. The loader then fetched a
path no emitted file had, and every wasm module in the build failed to load.

The settled hash is inlined instead, the way `GetChunkFilenameRuntimeModule`
already does it for chunk names: the runtime module re-renders after hashing
and writes the re-encoded value straight into the name. With nothing left to
read at runtime, those builds no longer pull in `getFullHash` either.

The digest predicate had been copied into two files and the `[fullhash]` one
into four more; both now come from `TemplatedPathPlugin`, next to the
re-encoder they describe.
@alexander-akait @claude
fix(esm): keep source maps aligned when a deferred specifier is fille…
dea26d5
…d in

The substitution ran at `PROCESS_ASSETS_STAGE_OPTIMIZE_HASH - 1`, long after
source maps are written (stage 500) and a minifier has run (stage 400). A
stand-in and the name replacing it are different lengths, so every mapping
after it on the same line moved — and in a minified bundle that is one line,
so effectively the whole file. `RealContentHashPlugin` is exempt from this
only because it swaps a hash for a hash of equal length.

Every hash the pass reads is settled well before then — `createHash` runs
ahead of every `processAssets` stage — so it now runs at `STAGE_DERIVED`,
ahead of anything that reads an asset, and replaces in place through
`ReplaceSource` so the asset carries its mappings across the edit.

Measured on a minified bundle: the emitted map's mappings sat 16 columns to
the right of the code they described, exactly the length a stand-in loses
when the real name replaces it.

A stand-in reaching the source-map stage is now a build error in
`configCases/analyzable/deferred-before-source-maps`.
@alexander-akait @claude
feat(esm): defer an analyzable name without optimization.realContentHash
285abbf
The gate asked for `RealContentHashPlugin` because substituting rewrites a
chunk after its own content hash was taken, leaving the name it is emitted
under describing content it no longer has. That only costs anything when a
name is built from content: with `[name].js` there is nothing to go stale,
and the repair pass has nothing to repair.

So deferring is now allowed either way — when the repair pass is there, or
when no emitted javascript takes its name from its own content. A templated
public path and a `[fullhash]` wasm name therefore bake in a plain
development build, where `realContentHash` is off by default.

A hashed chunk name still needs the repair pass, and inherently so: the
referencing chunk's hash would have to depend on the referenced chunk's,
which is what `RealContentHashPlugin` settles after the fact.
@alexander-akait @claude
refactor: drop the dead chunk-graph guard from the analyzable predicate
e8aa664
`blockPromise` types `chunkGraph` as required and all six callers pass one,
so the check could never be false; `tsc` agrees once the parameter says so.
The origin module is a different matter — `require.ensure", an AMD `require`,
a lazy-once context and a container entry all leave it out — so that check
stays, with the callers that omit it named, and is now covered by
`configCases/analyzable/block-without-origin`.

Instrumenting each condition and running the suite is what separated the two:
across 24418 tests everything else in the predicate is reached, including the
public-path override and the worker chunk-loading branch.
@alexander-akait @claude
feat(esm): scope the public-path override to the runtimes it reaches
e29ef4a
Reassigning `__webpack_public_path__` anywhere turned off analyzable output
for the whole compilation. But `__webpack_require__.p` belongs to a runtime,
and a module is instantiated once per runtime, so a reassignment can only
reach the runtimes the reassigning module is in — an entry that never touches
the public path was giving up baked specifiers because a different entry did.

The overriding modules are now tracked per compilation rather than a single
flag, and the check places the module a reference is emitted into among their
runtimes. Where there is no chunk graph to place it with, such as the asset
generator deciding a module's source types before code generation, it still
answers for the whole compilation.

Covered by `configCases/analyzable/public-path-override-scope`, where one
entry reassigns the public path and another, in the same build, still bakes.
@alexander-akait
test(analyzable): cover a deferred specifier through terser and sourc…
afe772c
…e maps

The ordering fix had no case with a real minifier: `deferred-before-source-maps`
asserts structurally that no stand-in reaches stage 500, but nothing built a
minified bundle and checked the map against it. The new case runs terser over a
hash-named chunk and asserts no mapping points past the end of the line it
names — which is exactly how the stand-in's extra length showed up. It fails
when the substitution is moved back to `OPTIMIZE_HASH - 1`.

Marked for RoundTripConfigCases so the minified specifier is re-bundled too.
@alexander-akait
alexander-akait force-pushed the feat/analyzable-public-path-override-scope branch from 3b09c2b to afe772c Compare August 11, 2026 08:36
alexander-akait added 2 commits August 11, 2026 08:38
@alexander-akait
chore: restore the changeset layout and the CRLF fix lost in the rebase
497d282
The rebase dropped three commits as already-upstream, which reverted 021 (a
merged PR's entry) to a modified state, brought back the two changesets it
replaced, and undid the trailing-\r fix the Windows shards caught.
@alexander-akait
test: restore the wasm digest cases and the Node gate lost in the rebase
fdf50af
A tree comparison against the pre-rebase head found three more casualties: the
two cases covering the fullHash runtime modules, and the supportsRequireInModule
filter that keeps block-without-origin off the Node versions whose vm ESM runner
cannot link createRequire.
@github-actions github-actions Bot added the area: optimization Tree-shaking, splitChunks, concatenation, ids (lib/optimize, lib/ids) label Aug 11, 2026
@alexander-akait
feat(esm): bake an analyzable specifier from a concatenated origin
424df4a
Concatenation replaces every module it absorbs with one `ConcatenatedModule`, so
the chunk graph places the latter and knows nothing about the former. The analyzable
predicates asked it about the module that wrote the reference, which under
`optimization.concatenateModules` — on by default in production — is an absorbed
one: no chunks, so no output depth to make the specifier relative to, and the
literal was dropped for the runtime form.

Resolving through the containing `ConcatenatedModule` also un-blinds the two
guards that read runtimes: a worker entry not loading through `import`, and a
`__webpack_public_path__` reassignment in an absorbed module — both were being
asked about a module in no runtime at all.

`statsCases/output-module` shows the effect on a case that is not new: its entry
is a concatenation, and it now sheds two runtime modules (5 → 3).
@alexander-akait
alexander-akait force-pushed the feat/analyzable-public-path-override-scope branch from 8856213 to 424df4a Compare August 11, 2026 09:09
@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Types Coverage

Coverage after merging feat/analyzable-public-path-override-scope into main will be
99.26%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
bin
   webpack.js98.82%100%100%98.82%103
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/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
   APIPlugin.js100%100%100%100%
   AsyncDependenciesBlock.js100%100%100%100%
   AutomaticPrefetchPlugin.js100%100%100%100%
   BannerPlugin.js100%100%100%100%
   Cache.js98.21%100%100%98.21%101
   CacheFacade.js100%100%100%100%
   Chunk.js99.72%100%100%99.72%39
   ChunkGraph.js100%100%100%100%
   ChunkGroup.js100%100%100%100%
   ChunkTemplate.js100%100%100%100%
   CircularModulesPlugin.js98.81%100%100%98.81%136
   CleanPlugin.js99.12%100%100%99.12%214, 234
   CodeGenerationResults.js100%100%100%100%
   CompatibilityPlugin.js100%100%100%100%
   Compilation.js98.44%100%100%98.44%1673, 1992, 1999, 2007, 2029, 2032, 2971, 3450–3451, 3483, 4192, 4222, 4275–4276, 4280, 4285, 4301–4302, 4316–4317, 4322–4323, 4843, 4869, 549, 554, 5679, 5711, 5728, 5746, 5762, 5777, 5802–5803, 5805, 6140, 6145, 6151, 6154, 6161, 6173, 6175, 6179, 6197, 6212, 6246, 6302, 6326, 6442, 801–802
   Compiler.js99.56%100%100%99.56%1168–1169, 1177
   ConcatenationScope.js99.12%100%100%99.12%300
   ConditionalInitFragment.js100%100%100%100%
   ConstPlugin.js100%100%100%100%
   ContextExclusionPlugin.js100%100%100%100%
   ContextModule.js99.88%100%100%99.88%1461
   ContextModuleFactory.js97.20%100%100%97.20%266, 435, 456, 461, 501, 512, 514, 518, 527–528
   ContextReplacementPlugin.js100%100%100%100%
   DefinePlugin.js99.08%100%100%99.08%1080, 176–177, 193, 212, 286
   DependenciesBlock.js100%100%100%100%
   Dependency.js98.51%100%100%98.51%480, 527
   DependencyTemplate.js100%100%100%100%
   DependencyTemplates.js100%100%100%100%
   DotenvPlugin.js98.41%100%100%98.41%378, 391–392
   DynamicEntryPlugin.js100%100%100%100%
   EntryOptionPlugin.js100%100%100%100%
   EntryPlugin.js100%100%100%100%
   Entrypoint.js100%100%100%100%
   EnvironmentPlugin.js97.14%100%100%97.14%49
   ErrorHelpers.js100%100%100%100%
   EvalDevToolModulePlugin.js100%100%100%100%
   EvalSourceMapDevToolPlugin.js100%100%100%100%
   ExportsInfo.js100%100%100%100%
   ExportsInfoApiPlugin.js100%100%100%100%
   ExternalModule.js98.67%100%100%98.67%1220, 1223, 519–523, 525, 671
   ExternalModuleFactoryPlugin.js100%100%100%100%
   ExternalsPlugin.js100%100%100%100%
   FileSystemInfo.js99.53%100%100%99.53%186, 2454–2455, 2458, 2469, 2480, 2491, 284, 3928, 3943, 3967
   FlagAllModulesAsUsedPlugin.js100%100%100%100%
   FlagDependencyExportsPlugin.js98.36%100%100%98.36%504, 513, 516, 520, 532
   FlagDependencyUsagePlugin.js100%100%100%100%
   FlagEntryExportAsUsedPlugin.js100%100%100%100%
   Generator.js100%100%100%100%
   HotModuleReplacementPlugin.js100%100%100%100%
   HotUpdateChunk.js100%100%100%100%
   IgnorePlugin.js100%100%100%100%
   IgnoreWarningsPlugin.js100%100%100%100%
   InitFragment.js100%100%100%100%
   JavascriptMetaInfoPlugin.js100%100%100%100%
   LazyBarrel.js100%100%100%100%
   LibraryTemplatePlugin.js100%100%100%100%
   LoaderOptionsPlugin.js100%100%100%100%
   LoaderTargetPlugin.js100%100%100%100%
   MainTemplate.js100%100%100%100%
   ManifestPlugin.js100%100%100%100%
   Module.js98.51%100%100%98.51%1303, 1308, 1368, 1382, 1444, 1453
   ModuleFactory.js100%100%100%100%
   ModuleFilenameHelpers.js98.90%100%100%98.90%111, 113
   ModuleGraph.js99.78%100%100%99.78%1170
   ModuleGraphConnection.js100%100%100%100%
   ModuleInfoHeaderPlugin.js100%100%100%100%
   ModuleNotFoundError.js100%100%100%100%
   ModuleProfile.js100%100%100%100%
   ModuleSourceTypeConstants.js100%100%100%100%
   ModuleTemplate.js100%100%100%100%
   ModuleTypeConstants.js100%100%100%100%
   MultiCompiler.js99.72%100%100%99.72%721
   MultiStats.js100%100%100%100%
   MultiWatching.js100%100%100%100%
   NoEmitOnErrorsPlugin.js100%100%100%100%
   NodeStuffPlugin.js100%100%100%100%
   NormalModule.js97.99%100%100%97.99%1027, 1030, 1047, 1064, 1312, 1346, 1362, 1817, 2114, 2119–2129, 29
   NormalModuleFactory.js98.77%100%100%98.77%1142, 1410, 1421, 1431, 1482–1484, 1491, 536, 548
   NormalModuleReplacementPlugin.js100%100%100%100%
   NullFactory.js100%100%100%100%
   OptimizationStages.js100%100%100%100%
   OptionsApply.js100%100%100%100%
   Parser.js100%100%100%100%
   PlatformPlugin.js100%100%100%100%
   PrefetchPlugin.js100%100%100%100%
   ProgressPlugin.js99.80%100%100%99.80%690
   ProvidePlugin.js100%100%100%100%
   RawModule.js100%100%100%100%
   RecordIdsPlugin.js100%100%100%100%
   RequestShortener.js100%100%100%100%
   ResolverFactory.js100%100%100%100%
   RuntimeGlobals.js100%100%100%100%
   RuntimeModule.js100%100%100%100%
   RuntimePlugin.js95.69%100%100%95.69%310, 366, 375, 378, 402, 420, 441–442, 465, 485–486, 522–523, 546, 559–560, 632, 645, 666, 685
   RuntimeTemplate.js99.90%100%100%99.90%122
   SelfModuleFactory.js100%100%100%100%
   SingleEntryPlugin.js100%100%100%100%
   SourceMapDevToolModuleOptionsPlugin.js100%100%100%100%
   SourceMapDevToolPlugin.js98.63%100%100%98.63%220, 224, 226, 420, 431, 890
   Stats.js100%100%100%100%
   Template.js100%100%100%100%
   TemplatedPathPlugin.js99.48%100%100%99.48%364–365
   UseStrictPlugin.js100%100%100%100%
   WarnCaseSensitiveModulesPlugin.js100%100%100%100%
   WarnDeprecatedOptionPlugin.js100%100%100%100%
   WarnNoModeSetPlugin.js100%100%100%100%
   WatchIgnorePlugin.js100%100%100%100%
   Watching.js100%100%100%100%
   WebpackError.js100%100%100%100%
   WebpackIsIncludedPlugin.js100%100%100%100%
   WebpackOptionsApply.js100%100%100%100%
   WebpackOptionsDefaulter.js100%100%100%100%
   buildChunkGraph.js99.87%100%100%99.87%376
   cli.js98.63%100%100%98.63%10, 119, 549, 581, 631, 905
   index.js99.73%100%100%99.73%184
   validateSchema.js94.67%100%100%94.67%100, 87, 89, 98
   webpack.js97.12%100%100%97.12%10, 267, 289, 291
lib/asset
   AssetBytesGenerator.js100%100%100%100%
   AssetBytesParser.js100%100%100%100%
   AssetGenerator.js100%100%100%100%
   AssetModule.js100%100%100%100%
   AssetModulesPlugin.js98.15%100%100%98.15%330, 354, 357, 487, 49, 54
   AssetParser.js100%100%100%100%
   AssetSourceGenerator.js100%100%100%100%
   AssetSourceParser.js100%100%100%100%
   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%
   IdleFileCachePlugin.js97.92%100%100%97.92%75, 87, 95
   MemoryCachePlugin.js92%100%100%92%34, 43
   MemoryWithGcCachePlugin.js93.42%100%100%93.42%108, 122–123, 132, 90
   PackFileCacheStrategy.js96.52%100%100%96.52%1310, 1410, 1414, 1476, 1712, 1796, 1819, 1851, 675, 694, 704–706, 708, 724–725, 730, 733, 735, 740, 745, 770, 776, 810,
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@alexander-akait
alexander-akait merged commit bc65f6b into main Aug 11, 2026
64 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@alexander-akait
alexander-akait deleted the feat/analyzable-public-path-override-scope branch August 11, 2026 10:14
@github-actions github-actions Bot mentioned this pull request Aug 11, 2026
chore(release): new release #21545
Merged
@codspeed

codspeed Bot commented Aug 11, 2026

Copy link
Copy Markdown

Unable to generate the flame graphs

The performance report has correctly been generated, but there was an internal error while generating the flame graphs for this run. We're working on fixing the issue. Feel free to contact us on Discord or at [email protected] if the issue persists.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@alexander-akait alexander-akait mentioned this pull request Aug 11, 2026
feat(esm): widen where analyzable references bake, and report why they don't #21680
Merged
This was referenced Aug 11, 2026
feat(esm): bake analyzable references per asset, and drop the asset wrapper no one reads #21688
Merged
fix(esm): correct analyzable references that could go stale, resolve wrongly, or fail the build #21699
Merged
fix(esm): bake analyzable imports for blocks that name no module of their own #21722
Merged
fix(analyzable): report the silent fallbacks, group wasm by shared binary, drop unread runtime #21742
Merged
feat(analyzable): bake a wasm url under a relative public path #21760
Merged
@coderabbitai coderabbitai Bot mentioned this pull request Aug 20, 2026
feat(analyzable): bake a lazy context's chunk imports into its map #21772
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@coderabbitai coderabbitai[bot] coderabbitai[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

area: optimization Tree-shaking, splitChunks, concatenation, ids (lib/optimize, lib/ids) area: parser JavaScript parsing and dependency analysis (lib/javascript, lib/dependencies) area: runtime Emitted runtime and chunk loading across targets (lib/runtime, lib/web, lib/node, lib/esm) area: sourcemaps devtool and source map generation area: types types.d.ts, JSDoc annotations, hand-maintained declarations area: wasm WebAssembly modules (lib/wasm-*)

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@alexander-akait
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.