Skip to content

feat: add output.environment.let option and emit let/const in generated code#21010

Merged
alexander-akait merged 5 commits into
mainfrom
claude/add-supports-let-option-GLCe1
May 25, 2026
Merged

feat: add output.environment.let option and emit let/const in generated code#21010
alexander-akait merged 5 commits into
mainfrom
claude/add-supports-let-option-GLCe1

Conversation

@alexander-akait

Copy link
Copy Markdown
Member

Add a new output.environment.let option (mirroring output.environment.const)
so targets can advertise let support independently of const. RuntimeTemplate
gains supportsLet() / renderLet(), and renderConst() now falls back to
let before var.

Generated runtime/bootstrap/library/sharing/css/wasm/container/HMR code now uses
const or let instead of var wherever it is safe. Bindings that may be
wrapped in runtime-condition if blocks (harmony imports, ConcatenatedModule
external imports) keep var to preserve function scoping.

Copilot AI review requested due to automatic review settings May 21, 2026 16:35
@changeset-bot

changeset-bot Bot commented May 21, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4d1c287

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

@github-actions

github-actions Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

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

Install it locally:

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

Comment thread lib/RuntimeTemplate.js
* @returns {"let" | "var"} return `let` when it is supported, otherwise `var`
*/
renderLet() {
return this.supportsLet() ? "let" : "var";
Comment thread lib/RuntimeTemplate.js
Comment on lines 415 to 418
const err = `Cannot find module '${request}'`;
return `var e = new Error(${JSON.stringify(
return `${this.renderConst()} e = new Error(${JSON.stringify(
err
)}); e.code = 'MODULE_NOT_FOUND'; throw e;`;

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a new output.environment.let capability (separate from output.environment.const) and updates webpack’s generated runtime/bootstrap code to prefer const or let over var when safe, improving output modernity while preserving var where function-scoping is required.

Changes:

  • Add output.environment.let to options schema/types/defaults/targets (including browserslist handling).
  • Extend RuntimeTemplate with supportsLet() / renderLet() and make renderConst() fall back to let before var.
  • Update many runtime modules and snapshots to emit const/let declarations where appropriate, plus add a new config case for environment-let.

Reviewed changes

Copilot reviewed 66 out of 69 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
types.d.ts Updates public typings for Environment.let and new RuntimeTemplate APIs/return types.
declarations/WebpackOptions.d.ts Adds Environment.let to generated option declarations.
schemas/WebpackOptions.json Adds schema support for output.environment.let.
lib/config/defaults.js Computes default environment.let (tied to targets/environment.const).
lib/config/target.js Adds let to target properties (but JSDoc text for const is now misleading).
lib/config/browserslistTargetHandler.js Adds browserslist feature detection for let.
lib/RuntimeTemplate.js Adds supportsLet() / renderLet(); renderConst() now falls back to let; uses renderLet() in destructuring helpers.
lib/javascript/JavascriptModulesPlugin.js Switches bootstrap/runtime variable declarations to const/let where safe; keeps let for __webpack_exports__ due to reassignment.
lib/web/JsonpChunkLoadingRuntimeModule.js Uses renderConst()/renderLet() for installed-chunks and loader internals.
lib/esm/ModuleChunkLoadingRuntimeModule.js Uses renderConst()/renderLet() for ESM chunk loading runtime declarations.
lib/node/RequireChunkLoadingRuntimeModule.js Uses renderConst() in node chunk loading runtime.
lib/runtime/LoadScriptRuntimeModule.js Uses renderConst()/renderLet() for runtime script-loader internals.
lib/runtime/OnChunksLoadedRuntimeModule.js Uses renderConst()/renderLet() for deferred queue bookkeeping.
lib/runtime/StartupEntrypointRuntimeModule.js Uses renderConst() for local temporaries.
lib/runtime/StartupChunkDependenciesRuntimeModule.js Uses renderConst() for next binding.
lib/runtime/RelativeUrlRuntimeModule.js Uses renderConst() for locals in helper runtime.
lib/runtime/GetTrustedTypesPolicyRuntimeModule.js Uses renderLet() for mutable policy binding.
lib/runtime/CreateFakeNamespaceObjectRuntimeModule.js Uses renderConst()/renderLet() for helper locals.
lib/runtime/CompatGetDefaultExportRuntimeModule.js Uses renderConst() for getter binding.
lib/runtime/AutoPublicPathRuntimeModule.js Uses renderConst()/renderLet(); security rationale comment appears truncated.
lib/runtime/AsyncModuleRuntimeModule.js Uses renderConst()/renderLet() broadly for async module runtime locals.
lib/runtime/MakeDeferredNamespaceObjectRuntime.js Uses renderConst()/renderLet() for deferred-namespace runtime locals.
lib/sharing/ShareRuntimeModule.js Uses renderConst()/renderLet() for sharing runtime locals.
lib/sharing/ConsumeSharedRuntimeModule.js Uses renderConst() for many helper bindings and tables.
lib/container/RemoteRuntimeModule.js Uses renderConst()/renderLet() for remote loading runtime locals.
lib/container/FallbackModule.js Uses renderConst()/renderLet() for fallback loop locals.
lib/container/ContainerEntryModule.js Uses renderConst() for container runtime bindings (moduleMap, get, init).
lib/library/AssignLibraryPlugin.js Uses renderConst() for export-target locals in generated wrappers.
lib/hmr/LazyCompilationPlugin.js Uses renderConst()/renderLet() for proxy module locals.
lib/ExternalModule.js Uses renderConst() for small helper bindings in external module wrappers and script externals.
lib/css/CssLoadingRuntimeModule.js Uses renderConst()/renderLet() for CSS chunk runtime locals.
lib/css/CssInjectStyleRuntimeModule.js Uses renderConst() for style injection runtime locals.
lib/ContextModule.js Threads runtimeTemplate into more codegen paths to emit const/var appropriately.
lib/optimize/ConcatenatedModule.js Documents why certain external bindings must remain var.
test/Defaults.unittest.js Updates defaults snapshots to include environment.let.
test/configCases/output/environment-let/webpack.config.js New test matrix covering const+let / let-only / neither.
test/configCases/output/environment-let/index.js New assertions that generated bootstrap uses const/let/var as expected.
test/configCases/sharing/consume-shared-stable-runtime/test.config.js Loosens regex to accept `var
test/configCases/library/module-useless-export-requirement/entry1.js Accepts `var
test/configCases/library/module-useless-export-requirement/entry2.js Accepts `var
test/configCases/library/module-useless-export-requirement/entry3.js Accepts `var
test/configCases/library/render-order-issue/snapshots/ConfigTest.snap Snapshot updated for const module cache and let exports binding.
test/configCases/library/modern-module-named-import-externals/snapshots/ConfigTest.snap Snapshot updated to use const in remapping helpers and module cache.
test/configCases/library/1-use-library/snapshots/errors.snap New snapshot now expecting a redeclaration error (likely regression).
test/configCases/html/script-src/index.js Updates assertion to accept `var
test/configCases/html/script-src/snapshots/ConfigTest.snap Snapshot updated to use const require scope/cache and let exports binding.
test/configCases/html/script-src-mixed/snapshots/ConfigTest.snap Snapshot updated similarly for mixed script cases.
test/configCases/html/script-src-classic/snapshots/ConfigTest.snap Snapshot updated similarly for classic script cases.
test/configCases/html/modulepreload-esm/snapshots/ConfigTest.snap Snapshot updated similarly.
test/configCases/html/inline-script-classic/snapshots/ConfigTest.snap Snapshot updated similarly.
test/configCases/ecmaVersion/browserslist/webpack.config.js Adds environment.let to expected resolved environment.
test/configCases/ecmaVersion/browserslist-query/webpack.config.js Adds environment.let to expected resolved environment.
test/configCases/ecmaVersion/browserslist-query-with-config-file/webpack.config.js Adds environment.let to expected resolved environment.
test/configCases/ecmaVersion/browserslist-extends/webpack.config.js Adds environment.let to expected resolved environment.
test/configCases/ecmaVersion/browserslist-env/webpack.config.js Adds environment.let to expected resolved environment.
test/configCases/ecmaVersion/browserslist-config/webpack.config.js Adds environment.let to expected resolved environment.
test/configCases/ecmaVersion/browserslist-config-extends/webpack.config.js Adds environment.let to expected resolved environment.
test/configCases/ecmaVersion/browserslist-config-env/webpack.config.js Adds environment.let to expected resolved environment.
test/configCases/ecmaVersion/browserslist-config-env-extends/webpack.config.js Adds environment.let to expected resolved environment.
test/configCases/chunks-order/cjs/snapshots/ConfigTest.snap Snapshot updates one binding to const.
test/configCases/css/public-path/snapshots/ConfigTest.snap Snapshot updates asset hashes (likely due to output changes).
test/configCases/css/css-auto/snapshots/errors.snap New snapshot now accepting less-loader compilation errors (likely unintended).
test/configCases/css/css-loader/snapshots/errors.snap New snapshot now accepting compilation errors (likely unintended).
test/configCases/css/css-loader/snapshots/warnings.snap New warning snapshot for css-loader case.
test/configCases/css/local-ident-name/snapshots/errors.snap New snapshot now accepting less-loader compilation errors (likely unintended).
test/configCases/css/prefer-relative-css-import/snapshots/errors.snap New snapshot now accepting less-loader compilation errors (likely unintended).
test/configCases/css/source-map-export-types/snapshots/errors.snap New snapshot now accepting less-loader compilation errors (likely unintended).
.changeset/output-environment-let.md Adds a changeset entry documenting the new option and codegen behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/config/target.js Outdated
@@ -60,6 +60,7 @@ const getDefaultTarget = (context) => {
* @property {boolean | null} globalThis has globalThis variable available
* @property {boolean | null} bigIntLiteral big int literal syntax is available
* @property {boolean | null} const const and let variable declarations are available
Comment on lines +4 to +8
Array [
Object {
"message": "Identifier 'fs__WEBPACK_IMPORTED_MODULE_0__' has already been declared (151:27)",
},
]
Comment on lines +5 to +8
Object {
"message": "Module build failed (from ../../../../node_modules/less-loader/dist/cjs.js):
NonErrorEmittedError: (Emitted value instead of an instance of Error) TypeError [ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING_FLAG]: A dynamic import callback was invoked without --experimental-vm-modules",
"moduleName": "css ./global.less",
Comment on lines +5 to +9
Object {
"compilerPath": "link",
"message": "Module build failed (from ../../../../node_modules/less-loader/dist/cjs.js):
NonErrorEmittedError: (Emitted value instead of an instance of Error) TypeError [ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING_FLAG]: A dynamic import callback was invoked without --experimental-vm-modules",
"moduleName": "css ./foo.less (exportType: link)",
Comment on lines +5 to +8
Object {
"message": "Module build failed (from ../../../../node_modules/less-loader/dist/cjs.js):
NonErrorEmittedError: (Emitted value instead of an instance of Error) TypeError [ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING_FLAG]: A dynamic import callback was invoked without --experimental-vm-modules",
"moduleName": "css ./style.module.less",
Comment on lines +5 to +8
Object {
"message": "Module build failed (from ../../../../node_modules/less-loader/dist/cjs.js):
NonErrorEmittedError: (Emitted value instead of an instance of Error) TypeError [ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING_FLAG]: A dynamic import callback was invoked without --experimental-vm-modules",
"moduleName": "css ./style.less",
Comment on lines +5 to +9
Object {
"compilerPath": "link-less",
"message": "Module build failed (from ../../../../node_modules/less-loader/dist/cjs.js):
NonErrorEmittedError: (Emitted value instead of an instance of Error) TypeError [ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING_FLAG]: A dynamic import callback was invoked without --experimental-vm-modules",
"moduleName": "css ./style.less",
"if (!scriptUrl && document) {",
Template.indent([
// Technically we could use `document.currentScript instanceof window.HTMLScriptElement`,
// but an attacker could try to inject `<script>HTMLScriptElement = HTMLImageElement</script>`
@codspeed-hq

codspeed-hq Bot commented May 21, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚡ 5 improved benchmarks
❌ 4 regressed benchmarks
✅ 135 untouched benchmarks
⏩ 72 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Memory benchmark "asset-modules-resource", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' 210.5 KB 353 KB -40.36%
Memory benchmark "cache-filesystem", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' 283 KB 184.2 KB +53.65%
Memory benchmark "css-modules", scenario '{"name":"mode-development","mode":"development"}' 542.5 KB 1,300.5 KB -58.29%
Memory benchmark "many-chunks-esm", scenario '{"name":"mode-production","mode":"production"}' 8.7 MB 7.1 MB +22.3%
Memory benchmark "many-chunks-commonjs", scenario '{"name":"mode-development","mode":"development"}' 831.5 KB 1,054.5 KB -21.15%
Memory benchmark "asset-modules-source", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' 241.4 KB 167.3 KB +44.27%
Memory benchmark "devtool-eval", scenario '{"name":"mode-production","mode":"production"}' 7.7 MB 6.4 MB +21.23%
Memory benchmark "side-effects-reexport", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' 1.3 MB 1 MB +32%
Memory benchmark "future-defaults", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' 151.6 KB 327.5 KB -53.7%

Tip

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


Comparing claude/add-supports-let-option-GLCe1 (4d1c287) with main (c95b845)

Open in CodSpeed

Footnotes

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

alexander-akait added a commit that referenced this pull request May 21, 2026
- target.js: drop ", and let" from the `const` capability JSDoc now that
  `let` is a separate property.
- AutoPublicPathRuntimeModule: restore the third line of the security
  rationale comment (`<img name="currentScript">` attack vector) that was
  truncated during the earlier const/let edit.
- Remove seven spurious snapshot files that were accidentally committed.
  They were generated by an earlier test run without
  `--experimental-vm-modules`, so they captured less-loader infrastructure
  errors and a downstream redeclaration error rather than real failures.
  All affected tests pass cleanly when run with the proper flag.
@alexander-akait alexander-akait requested a review from Copilot May 22, 2026 00:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 59 out of 62 changed files in this pull request and generated no new comments.

@codecov

codecov Bot commented May 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.03960% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.63%. Comparing base (cfb24a4) to head (4d1c287).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
lib/RuntimeTemplate.js 85.71% 2 Missing ⚠️
lib/ContextModule.js 95.65% 1 Missing ⚠️
lib/javascript/JavascriptModulesPlugin.js 94.44% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #21010      +/-   ##
==========================================
+ Coverage   91.59%   91.63%   +0.03%     
==========================================
  Files         573      573              
  Lines       59582    59766     +184     
  Branches    16094    16144      +50     
==========================================
+ Hits        54576    54764     +188     
+ Misses       5006     5002       -4     
Flag Coverage Δ
integration 89.56% <96.03%> (+0.04%) ⬆️
test262 45.41% <45.97%> (+0.10%) ⬆️
unit 37.86% <14.63%> (-0.09%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 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.

Copilot AI review requested due to automatic review settings May 22, 2026 00:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 70 out of 73 changed files in this pull request and generated no new comments.

alexander-akait added a commit that referenced this pull request May 25, 2026
- target.js: drop ", and let" from the `const` capability JSDoc now that
  `let` is a separate property.
- AutoPublicPathRuntimeModule: restore the third line of the security
  rationale comment (`<img name="currentScript">` attack vector) that was
  truncated during the earlier const/let edit.
- Remove seven spurious snapshot files that were accidentally committed.
  They were generated by an earlier test run without
  `--experimental-vm-modules`, so they captured less-loader infrastructure
  errors and a downstream redeclaration error rather than real failures.
  All affected tests pass cleanly when run with the proper flag.
Copilot AI review requested due to automatic review settings May 25, 2026 15:48
@alexander-akait alexander-akait force-pushed the claude/add-supports-let-option-GLCe1 branch from 4a6bb10 to c5edb6f Compare May 25, 2026 15:48
alexander-akait added a commit that referenced this pull request May 25, 2026
- target.js: drop ", and let" from the `const` capability JSDoc now that
  `let` is a separate property.
- AutoPublicPathRuntimeModule: restore the third line of the security
  rationale comment (`<img name="currentScript">` attack vector) that was
  truncated during the earlier const/let edit.
- Remove seven spurious snapshot files that were accidentally committed.
  They were generated by an earlier test run without
  `--experimental-vm-modules`, so they captured less-loader infrastructure
  errors and a downstream redeclaration error rather than real failures.
  All affected tests pass cleanly when run with the proper flag.
@alexander-akait alexander-akait force-pushed the claude/add-supports-let-option-GLCe1 branch from c5edb6f to fe562d1 Compare May 25, 2026 15:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 72 out of 75 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (2)

lib/web/JsonpChunkLoadingRuntimeModule.js:1

  • The abbreviations cst and lt are non-obvious in a codebase where const/let already have specific meaning. Consider renaming to something self-describing like constDecl / letDecl (or constKeyword / letKeyword) to make the generated-code intent easier to follow during maintenance.
    schemas/WebpackOptions.json:1
  • Schema descriptions in this file commonly format language tokens with backticks (e.g. import.meta.dirname). To stay consistent and avoid ambiguity, consider changing the description to use backticks around let (e.g. "The environment supports let for variable declarations.").

Comment thread lib/config/defaults.js
);
F(environment, "let", () =>
conditionallyOptimistic(
/** @type {boolean | undefined} */ (tp && tp.let),
alexander-akait added a commit that referenced this pull request May 25, 2026
- target.js: drop ", and let" from the `const` capability JSDoc now that
  `let` is a separate property.
- AutoPublicPathRuntimeModule: restore the third line of the security
  rationale comment (`<img name="currentScript">` attack vector) that was
  truncated during the earlier const/let edit.
- Remove seven spurious snapshot files that were accidentally committed.
  They were generated by an earlier test run without
  `--experimental-vm-modules`, so they captured less-loader infrastructure
  errors and a downstream redeclaration error rather than real failures.
  All affected tests pass cleanly when run with the proper flag.
@alexander-akait alexander-akait force-pushed the claude/add-supports-let-option-GLCe1 branch from fe562d1 to ae9dbc4 Compare May 25, 2026 16:02
@alexander-akait alexander-akait requested a review from Copilot May 25, 2026 16:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 72 out of 75 changed files in this pull request and generated 1 comment.

Comment on lines +123 to +141
let: rawChecker({
chrome: 49,
and_chr: 49,
edge: 12,
firefox: 44,
and_ff: 44,
// ie: Not supported
opera: 36,
op_mob: 36,
safari: [10, 0],
ios_saf: [10, 0],
samsung: [5, 0],
android: 49,
and_qq: [10, 4],
baidu: [13, 18],
and_uc: [12, 12],
kaios: [2, 5],
node: [6, 0]
}),

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The stricter let thresholds are intentional and reflect real engine support, so I've kept them and instead corrected the misleading comment in applyOutputDefaults that implied const always implies let.

Standard block-scoped let shipped later than const in some engines — e.g. Firefox got reliable block-scoped let in 44 (and Android WebView in 49), whereas webpack has tracked const from Firefox 36 / Android 37 (those Firefox numbers and notes predate this PR). So for a Firefox 36–43 browserslist target, const: true / let: false is the correct result, and we genuinely want to emit const but not let there.

The conditionallyOptimistic(tp.let, environment.const) fallback is purely for backward compatibility: it only kicks in when a target doesn't report let at all (undefined) — i.e. older/custom target objects that predate this capability and only declare const. Targets that do report let (browserslist and the built-in presets in target.js) keep their own accurate value, so there's no contradiction. Aligning the let map to the const versions would incorrectly claim let support for Firefox 36–43.


Generated by Claude Code

…ed code

Add a new `output.environment.let` option (mirroring `output.environment.const`)
so targets can advertise `let` support independently of `const`. `RuntimeTemplate`
gains `supportsLet()` / `renderLet()`, and `renderConst()` now falls back to
`let` before `var`.

Generated runtime/bootstrap/library/sharing/css/wasm/container/HMR code now uses
`const` or `let` instead of `var` wherever it is safe. Bindings that may be
wrapped in runtime-condition `if` blocks (harmony imports, ConcatenatedModule
external imports) keep `var` to preserve function scoping.
- target.js: drop ", and let" from the `const` capability JSDoc now that
  `let` is a separate property.
- AutoPublicPathRuntimeModule: restore the third line of the security
  rationale comment (`<img name="currentScript">` attack vector) that was
  truncated during the earlier const/let edit.
- Remove seven spurious snapshot files that were accidentally committed.
  They were generated by an earlier test run without
  `--experimental-vm-modules`, so they captured less-loader infrastructure
  errors and a downstream redeclaration error rather than real failures.
  All affected tests pass cleanly when run with the proper flag.
The `target-browserslist` and `Cli` snapshot suites enumerate every
`environment.*` capability / CLI flag, so the new `let` capability
needs to be reflected in their snapshots too. Pure additive snapshot
updates — no logic changes.
ConfigCacheTestCases reuses the same fixtures as ConfigTestCases but
keeps a parallel ConfigCacheTest.snap per case. Update those parallel
snapshots to match the new const/let bootstrap declarations — same
diffs that were already applied to ConfigTest.snap. Pure snapshot
updates, no logic changes.
The asset-size snapshots in Stats.test.js encode the exact byte length
of generated bundles. The new `const __webpack_module_cache__` / `let __webpack_exports__`
declarations are a couple bytes longer than the old `var` form, so the
recorded asset sizes shift by ~10 bytes per entry chunk. Snapshot-only
update; no logic change.
@alexander-akait alexander-akait force-pushed the claude/add-supports-let-option-GLCe1 branch from ae9dbc4 to 4d1c287 Compare May 25, 2026 16:39
@github-actions

Copy link
Copy Markdown
Contributor

Types Coverage

Coverage after merging claude/add-supports-let-option-GLCe1 into main will be
98.97%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
bin
   webpack.js98.77%100%100%98.77%91
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.js91.30%100%100%91.30%140, 142–143, 145, 147, 153–154, 161, 168, 90
examples/markdown
   webpack.config.mjs100%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-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%
   CleanPlugin.js99.15%100%100%99.15%206, 226
   CodeGenerationResults.js100%100%100%100%
   CompatibilityPlugin.js100%100%100%100%
   Compilation.js98.45%100%100%98.45%1572, 1868, 1875, 1883, 1905, 2801, 3226, 3888, 3917, 3970–3971, 3975, 3980, 3996–3997, 4011–4012, 4017–4018, 4495, 4521, 511, 516, 5229, 5261, 5278, 5294, 5310, 5325, 5350–5351, 5353, 5681, 5686, 5692, 5695, 5707, 5709, 5713, 5729, 5744, 5776, 5830, 5854, 5968, 730–731
   Compiler.js99.56%100%100%99.56%1135–1136, 1144
   ConcatenationScope.js98.59%100%100%98.59%189
   ConditionalInitFragment.js100%100%100%100%
   ConstPlugin.js100%100%100%100%
   ContextExclusionPlugin.js100%100%100%100%
   ContextModule.js100%100%100%100%
   ContextModuleFactory.js97.40%100%100%97.40%258, 395, 418, 420, 424, 433–434
   ContextReplacementPlugin.js100%100%100%100%
   DefinePlugin.js98.92%100%100%98.92%158–159, 175, 194, 268
   DependenciesBlock.js100%100%100%100%
   Dependency.js98.20%100%100%98.20%381, 427
   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.97%100%100%98.97%425–429, 577
   ExternalModuleFactoryPlugin.js100%100%100%100%
   ExternalsPlugin.js100%100%100%100%
   FileSystemInfo.js99.50%100%100%99.50%182, 2252–2253, 2256, 2267, 2278, 2289, 278, 3694, 3709, 3733
   FlagAllModulesAsUsedPlugin.js100%100%100%100%
   FlagDependencyExportsPlugin.js98.78%100%100%98.78%409, 411, 415
   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%
   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.50%100%100%98.50%1306, 1311, 1372, 1386, 1448, 1457
   ModuleFactory.js100%100%100%100%
   ModuleFilenameHelpers.js98.85%100%100%98.85%106, 108
   ModuleGraph.js99.73%100%100%99.73%1004
   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.69%100%100%99.69%659
   MultiStats.js100%100%100%100%
   MultiWatching.js100%100%100%100%
   NoEmitOnErrorsPlugin.js100%100%100%100%
   NodeStuffPlugin.js100%100%100%100%
   NormalModule.js98.11%100%100%98.11%1208, 1211, 1228, 1245, 1492, 1526, 1542, 1629, 2252, 2257–2267, 569
   NormalModuleFactory.js99.47%100%100%99.47%1083, 1392, 486, 498
   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.js98.85%100%100%98.85%519–520, 525, 527, 591
   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.js100%100%100%100%
   RuntimeTemplate.js100%100%100%100%
   SelfModuleFactory.js100%100%100%100%
   SingleEntryPlugin.js100%100%100%100%
   SourceMapDevToolModuleOptionsPlugin.js100%100%100%100%
   SourceMapDevToolPlugin.js98.62%100%100%98.62%220, 224, 226, 419, 430, 891
   Stats.js100%100%100%100%
   Template.js100%100%100%100%
   TemplatedPathPlugin.js98.86%100%100%98.86%136–137
   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%326
   cli.js98.46%100%100%98.46%10, 119, 471, 503, 545, 815
   index.js99.72%100%100%99.72%165
   validateSchema.js94.67%100%100%94.67%100, 87, 89, 98
   webpack.js96.33%100%100%96.33%10, 198, 220, 222
lib/asset
   AssetBytesGenerator.js100%100%100%100%
   AssetBytesParser.js100%100%100%100%
   AssetGenerator.js100%100%100%100%
   AssetModulesPlugin.js97.32%100%100%97.32%283, 307, 310, 36, 362, 41
   AssetParser.js100%100%100%100%
   AssetSourceGenerator.js100%100%100%100%
   AssetSourceParser.js100%100%100%100%
   RawDataUrlModule.js100%100%100%100%
lib/async-modules
   AsyncModuleHelpers.js100%100%100%100%
   AwaitDependenciesInitFragment.js100%100%100%100%
   InferAsyncModulesPlugin.js100%100%100%100%
lib/cache
   AddBuildDependenciesPlugin.js100%100%100%100%
   AddManagedPathsPlugin.js100%100%100%100%
   IdleFileCachePlugin.js97.92%100%100%97.92%71, 83, 91
   MemoryCachePlugin.js95.83%100%100%95.83%33
   MemoryWithGcCachePlugin.js93.15%100%100%93.15%106, 113–114, 122, 89
   PackFileCacheStrategy.js96.40%100%100%96.40%1250, 1350, 1354, 1416, 628, 647, 657–659, 661, 677–678, 683, 686, 688, 693, 698, 722, 728, 762, 768, 774, 779, 790, 799, 804–805, 807, 824, 830–831, 833
   ResolverCachePlugin.js100%100%100%100%
   getLazyHashedEtag.js100%100%100%100%
   mergeEtags.js100%100%100%100%
lib/config
   browserslistTargetHandler.js100%100%100%100%
   defaults.js99.29%100%100%99.29%1411–1413, 1421, 271, 274, 279, 283
   normalization.js99%100%100%99%191–192, 258, 273
   target.js100%100%100%100%
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%
   

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 72 out of 75 changed files in this pull request and generated no new comments.

@alexander-akait alexander-akait merged commit e42372c into main May 25, 2026
61 of 62 checks passed
@alexander-akait alexander-akait deleted the claude/add-supports-let-option-GLCe1 branch May 25, 2026 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants