Skip to content

fix(css): pass __webpack_require__ to "style" export type modules - #22833

Merged
alexander-akait merged 2 commits into
webpack:mainfrom
lazerg:fix/css-style-export-require
Oct 21, 2026
Merged

alexander-akait merged 2 commits into
webpack:mainfrom
lazerg:fix/css-style-export-require

Conversation

@lazerg

@lazerg lazerg commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #22832

A CSS module with exportType: "style" calls __webpack_require__.is(...), but cssInjectStyle was missing from GLOBALS_ON_REQUIRE in RuntimePlugin, so the module factory never got the __webpack_require__ argument. It only worked when the module sat inside the runtime chunk. With runtimeChunk: "single" it throws ReferenceError: __webpack_require__ is not defined.

Before:

() {
__webpack_require__.is("./src/a.css", "...");

After:

(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
__webpack_require__.is("./src/a.css", "...");

What kind of change does this PR introduce?

fix

Did you add tests for your changes?

Yes, test/configCases/css/export-type-style-runtime-chunk.

Does this PR introduce a breaking change?

No

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

n/a

Use of AI

Yes, I used Claude Code to trace the cause and draft the fix and test. I reproduced the bug and checked the fix locally.

Summary by CodeRabbit

  • Bug Fixes

    • Fixed CSS modules using exportType: "style" so styles are correctly injected when loaded outside the runtime chunk.
    • Ensured stylesheet imports work reliably in builds that use a shared runtime chunk.
  • Tests

    • Added coverage verifying that CSS creates the expected <style> element and applies the associated styling in the document.
  • Documentation

    • Documented the CSS runtime injection fix and its improved behavior across supported build configurations.

@changeset-bot

changeset-bot Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ab03de4

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

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

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

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

@github-actions github-actions Bot added the area: runtime Emitted runtime and chunk loading across targets (lib/runtime, lib/web, lib/node, lib/esm) label Oct 21, 2026
@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Repository: webpack/webpack/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9f33f3bc-7cbb-43d0-8edb-447b479ab8a9
📥 Commits

Reviewing files that changed from the base of the PR and between d8b713c and ab03de4.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: webpack/webpack/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6afe6c01-4f8a-4619-a33f-d9ab49442d7d
📥 Commits

Reviewing files that changed from the base of the PR and between ec14fb7 and d8b713c.

📒 Files selected for processing: 2
  • test/configCases/css/export-type-style-runtime-chunk/test.config.js
  • test/configCases/css/export-type-style-runtime-chunk/webpack.config.js

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

📝 Walkthrough

The runtime plugin now adds requireScope when a module uses RuntimeGlobals.cssInjectStyle. A regression test covers style injection with a separate runtime chunk. A patch changeset documents the fix.

Changes: CSS style runtime require

Layer / File(s) Summary
Runtime requirement and regression case
lib/runtime/RuntimePlugin.js, test/configCases/css/export-type-style-runtime-chunk/*, .changeset/060-css-style-export-require.md
RuntimeGlobals.cssInjectStyle is added to GLOBALS_ON_REQUIRE. The test config uses a single runtime chunk and checks for an injected style containing runtime-chunk. The changeset describes the fix.

Suggested labels: regression

Suggested reviewers: alexander-akait

Priority: ➖ Normal

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to d8b71

The fix and regression coverage address the reported CSS runtime-chunk failure without an established merge-blocking risk.

Pre-merge checks: Passed 3 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Title check Inconclusive The title uses the required Conventional Commit form and accurately describes the CSS runtime fix. The branch prefix is not provided, so the required type-to-branch match cannot be verified. Provide the branch name or confirm that its prefix is fix.
Passed Passed checks: 3 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check Passed Issue #22832 requires exportType: "style" CSS modules to receive __webpack_require__ when generated code uses RuntimeGlobals.cssInjectStyle, including a separate runtime chunk. `lib/runtime/Runt…
Out of Scope Changes check Passed The changes stay within issue #22832. The implementation changes one runtime-requirement mapping. The added configuration, CSS fixture, and test provide focused regression coverage. The changeset docu…
Full details: Linked Issues check

Explanation

Issue #22832 requires exportType: "style" CSS modules to receive __webpack_require__ when generated code uses RuntimeGlobals.cssInjectStyle, including a separate runtime chunk. lib/runtime/RuntimePlugin.js now includes RuntimeGlobals.cssInjectStyle in GLOBALS_ON_REQUIRE. The existing hooks then add RuntimeGlobals.requireScope for that module requirement. The regression test enables CSS, uses parser.exportType: "style", sets optimization.runtimeChunk: "single", and verifies style injection.

Full details: Out of Scope Changes check

Explanation

The changes stay within issue #22832. The implementation changes one runtime-requirement mapping. The added configuration, CSS fixture, and test provide focused regression coverage. The changeset documents the fix. No unrelated changes are shown.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

❤️ Share

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

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

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Reported by Types Coverage #1942 for ab03de4, computed by this pull request's own code.

Types Coverage

Coverage after merging fix/css-style-export-require into main will be
99.28%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
bin
   webpack.js98.86%100%100%98.86%113
declarations
   WebpackOptions.ts99.94%100%100%99.94%4240
examples
   build-common.js100%100%100%100%
   buildAll.js100%100%100%100%
   examples.js100%100%100%100%
   template-common.js98.21%100%100%98.21%72
examples/custom-javascript-parser
   test.filter.js100%100%100%100%
examples/custom-javascript-parser/internals
   acorn-parse.js100%100%100%100%
   meriyah-parse.js100%100%100%100%
   oxc-parse.js100%100%100%100%
examples/markdown
   webpack.config.mjs100%100%100%100%
examples/module-federation
   test.filter.js100%100%100%100%
examples/reexport-components
   test.filter.js100%100%100%100%
examples/ssr
   test.filter.js100%100%100%100%
examples/typescript
   test.filter.js100%100%100%100%
examples/typescript-non-erasable
   test.filter.js50%100%100%50%5
examples/virtual-modules
   test.filter.js100%100%100%100%
examples/wasm-bindgen-esm
   test.filter.js100%100%100%100%
examples/wasm-complex
   test.filter.js100%100%100%100%
examples/wasm-emscripten
   test.filter.js100%100%100%100%
examples/wasm-simple
   test.filter.js100%100%100%100%
examples/wasm-simple-source-phase
   test.filter.js100%100%100%100%
lib
   Chunk.js100%100%100%100%
   Compilation.js98.71%100%100%98.71%1783, 2096, 2103, 2111, 2133, 2136, 3124, 3683, 3726, 4315, 4319, 4446, 4467, 4592, 4629, 4636, 4689–4690, 4694, 4699, 4715–4716, 4730–4731, 4736–4737, 5265, 5291, 6141, 6158, 6176, 6192, 6207, 6232, 6235, 6603, 6606–6607, 6612, 6627, 6710, 6734, 855–856
   Compiler.js98.81%100%100%98.81%1116, 1153, 1156, 1336–1337, 1345, 848, 934, 975
   Dependency.js100%100%100%100%
   DependencyTemplate.js100%100%100%100%
   EntryPlugin.js100%100%100%100%
   Entrypoint.js100%100%100%100%
   ExternalsPlugin.js100%100%100%100%
   FileSystemInfo.js100%100%100%100%
   InitFragment.js100%100%100%100%
   LibraryTemplatePlugin.js100%100%100%100%
   ModuleFilenameHelpers.js100%100%100%100%
   ModuleNotFoundError.js100%100%100%100%
   MultiCompiler.js98.91%100%100%98.91%489, 561, 748, 813
   NormalModule.js100%100%100%100%
   NullFactory.js100%100%100%100%
   ProgressPlugin.js100%100%100%100%
   RawModule.js100%100%100%100%
   RequestShortener.js100%100%100%100%
   SingleEntryPlugin.js100%100%100%100%
   WebpackError.js100%100%100%100%
   index.js100%100%100%100%
   webpack.js98.59%100%100%98.59%306, 308
lib/asset
   AssetBytesGenerator.js100%100%100%100%
   AssetBytesParser.js91.67%100%100%91.67%27
   AssetGenerator.js100%100%100%100%
   AssetModule.js100%100%100%100%
   AssetModulesPlugin.js98.45%100%100%98.45%334, 360, 363, 493, 58
   AssetParser.js96.15%100%100%96.15%47
   AssetSourceGenerator.js100%100%100%100%
   AssetSourceParser.js91.67%100%100%91.67%27
   RawDataUrlModule.js100%100%100%100%
   WebManifestGenerator.js100%100%100%100%
   WebManifestParser.js100%100%100%100%
lib/async-modules
   AsyncModuleHelpers.js100%100%100%100%
   AwaitDependenciesInitFragment.js100%100%100%100%
   InferAsyncModulesPlugin.js100%100%100%100%
   isGeneratorLowered.js100%100%100%100%
lib/bun
   BunTargetPlugin.js100%100%100%100%
lib/cache
   AddBuildDependenciesPlugin.js100%100%100%100%
   AddManagedPathsPlugin.js100%100%100%100%
   Cache.js98.25%100%100%98.25%104
   CacheFacade.js100%100%100%100%
   IdleFileCachePlugin.js97.92%100%100%97.92%75, 87, 95
   MemoryCachePlugin.js92%100%100%92%33, 42
   MemoryWithGcCachePlugin.js93.42%100%100%93.42%106, 120–121, 130, 88
   PackFileCacheStrategy.js96.54%100%100%96.54%1306, 1406, 1410, 1472, 1718, 1802, 1825, 1855, 684, 703, 713–715, 717, 733–734, 739, 742, 744, 749, 754, 779, 785, 819, 825, 831, 836, 847, 856, 861–862, 864, 881, 887–888, 890
   ResolverCachePlugin.js100%100%100%100%
   getLazyHashedEtag.js100%100%100%100%
   mergeEtags.js100%100%100%100%
lib/config
   OptionsApply.js100%100%100%100%
   PlatformPlugin.js100%100%100%100%
   WebpackOptionsApply.js100%100%100%100%
   WebpackOptionsDefaulter.js100%100%100%100%
   browserslistTargetHandler.js100%100%100%100%
   cli.js98.89%100%100%98.89%114, 550, 582, 632
   defaults.js99.59%100%100%99.59%1633–1635, 1643, 288, 548
   defineConfig.js100%100%100%100%
   getClaimedAssetTypes.js100%100%100%100%
   normalization.js99.14%100%100%99.14%285–286, 356, 371
   target.js100%100%100%100%
   validateSchema.js94.67%100%100%94.67%100, 87, 89, 98
lib/container
   ContainerEntryDependency.js100%100%100%100%
   ContainerEntryModule.js100%100%100%100%
   ContainerEntryModuleFactory.js100%100%100%100%
   ContainerExposedDependency.js100%100%100%100%
   ContainerPlugin.js100%100%100%100%
   ContainerReferencePlugin.js100%100%100%100%
   FallbackDependency.js100%100%100%100%
   FallbackItemDependency.js100%100%100%100%
   FallbackModule.js100%100%100%100%
   FallbackModuleFactory.js100%100%100%100%
   HoistContainerReferencesPlugin.js100%100%100%100%
   ModuleFederationPlugin.js100%100%100%100%
   RemoteModule.js100%100%100%100%
   RemoteRuntimeModule.js100%100%100%100%
   RemoteToExternalDependency.js100%100%100%100%
   declaredRemotes.js100%100%100%100%
   moduleFederationHooks.js100%100%100%100%
   options.js100%100%100%100%
lib/context
   ContextExclusionPlugin.js100%100%100%100%
   ContextModule.js99.88%100%100%99.88%1495
   ContextModuleFactory.js95.70%100%100%95.70%230, 257, 276, 280–281, 289, 466, 487, 492, 534, 543, 545, 549, 552, 558–559
   ContextReplacementPlugin.js100%100%100%100%
lib/css
   CssGenerator.js99.29%100%100%99.29%1094, 129, 305, 847
   CssInjectStyleRuntimeModule.js100%100%100%100%
   CssLoadingRuntimeModule.js100%100%100%100%
   CssModule.js100%100%100%100%
   CssModulesPlugin.js98.72%100%100%98.72%217, 418, 432, 445, 458, 481, 494, 507, 520
   CssParser.js99.76%100%100%99.76%1090, 2425, 3072, 3075, 3081, 3514, 943
   CssServerStylesRuntimeModule.js100%100%100%100%
   conventions.js100%100%100%100%
   cssMinify.js100%100%100%100%
   data.js99.84%100%100%99.84%229, 5605
   syntax-parser.js99.69%100%100%99.69%11233–11234, 11786–11787, 11824, 12034, 12083, 14454, 14515–14518, 14623–14624, 14722–14723, 15481, 15777, 15779, 16310, 16702, 16744, 19022, 2631, 3338, 3340, 3345, 3364, 4113, 4119
   syntax-printer.js99.33%100%100%99.33%2614–2615, 2617–2618, 2620–2621, 2626, 2896–2899, 2992, 356, 3693, 4118, 4254, 4972, 5283, 6088, 730
   syntax.js100%100%100%100%
   topologicalSort.js100%100%100%100%
lib/debug
   ProfilingPlugin.js100%100%100%100%
lib/define
   DefinePlugin.js99.42%100%100%99.42%1488, 936, 938, 943, 967
   DotenvPlugin.js97.61%100%100%97.61%276, 395, 443, 456–457
   EnvironmentPlugin.js100%100%100%100%
lib/deno
   DenoTargetPlugin.js100%100%100%100%
lib/dependencies
   ConstDependency.js100%100%100%100%
   ContextElementDependency.js100%100%100%100%
   NullDependency.js100%100%100%100%
lib/dependencies/amd
   AMDDefineDependency.js100%100%100%100%
   AMDDefineDependencyParserPlugin.js100%100%100%100%
   AMDPlugin.js99.31%100%100%99.31%54
   AMDRequireArrayDependency.js100%100%100%100%
   AMDRequireContextDependency.js100%100%100%100%
   AMDRequireDependenciesBlock.js100%100%100%100%
   AMDRequireDependenciesBlockParserPlugin.js100%100%100%100%
   AMDRequireDependency.js100%100%100%100%
   AMDRequireItemDependency.js100%100%100%100%
   AMDRuntimeModules.js95.45%100%100%95.45%65
   LocalModule.js100%100%100%100%
   LocalModuleDependency.js100%100%100%100%
   LocalModulesHelpers.js100%100%100%100%
   RequireJsStuffPlugin.js100%100%100%100%
   UnsupportedDependency.js100%100%100%100%
lib/dependencies/commonjs
   CommonJsDependencyHelpers.js98.63%100%100%98.63%43
   CommonJsExportRequireDependency.js99.21%100%100%99.21%414,

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Reported by Code Size #5350 for ab03de4, computed by this pull request's own code.

Generated code size

Comparing base (59e0a49) to head (ab03de4). Merging this pull request changes the size of 10 asset(s) whose tests it leaves untouched and adds 4 new asset(s).

What moved Tests Assets Gzip Raw Test edit
Changed, test untouched 8 10 🔴 ↑ +107 B 🔴 ↑ +840 B —
Changed, test edited 0 0 — — —
New 1 4 ⚪ added +3.10 KiB ⚪ added +9.15 KiB —
Deleted 0 0 — — —
Unchanged — 9074 — — —

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

10 asset(s) changed size, test untouched
Asset Before After Change Gzip (9) Brotli (11) Zstd (19)
🔴 ↑ css/css-server-styles-order bundle0.js 5.30 KiB 5.43 KiB +140 B (+2.58%) +14 B (+0.91%) +15 B (+1.13%) +13 B (+0.85%)
🔴 ↑ css/css-server-styles-prerender bundle0.js 7.26 KiB 7.39 KiB +140 B (+1.88%) +8 B (+0.38%) +2 B (+0.11%) +7 B (+0.34%)
🔴 ↑ css/css-server-styles-global-this bundle0.js 4.45 KiB 4.52 KiB +70 B (+1.54%) +13 B (+0.95%) +12 B (+1.04%) +11 B (+0.80%)
🔴 ↑ css/css-server-styles-node-inject bundle0.mjs 4.60 KiB 4.67 KiB +70 B (+1.49%) +13 B (+0.93%) +2 B (+0.17%) +13 B (+0.93%)
🔴 ↑ css/css-server-styles bundle0.js 5.07 KiB 5.14 KiB +70 B (+1.35%) +14 B (+0.92%) +12 B (+0.92%) +16 B (+1.05%)
🔴 ↑ css/nosources-source-map-export-types style/bundle2.js 6.51 KiB 6.58 KiB +70 B (+1.05%) +14 B (+0.60%) +23 B (+1.13%) +13 B (+0.56%)
🔴 ↑ css/export-type-text-url js-in-subdir/js/bundle1.js 6.68 KiB 6.75 KiB +70 B (+1.02%) +1 B (+0.06%) -2 B (-0.13%) —
🔴 ↑ css/export-type-text-url js-at-root/bundle0.js 6.68 KiB 6.75 KiB +70 B (+1.02%) +1 B (+0.06%) -2 B (-0.13%) —
🔴 ↑ css/source-map-export-types style/bundle2.js 13.31 KiB 13.38 KiB +70 B (+0.51%) +15 B (+0.32%) +11 B (+0.27%) +12 B (+0.26%)
🔴 ↑ css/source-map-export-types style-less/bundle6.js 13.44 KiB 13.51 KiB +70 B (+0.51%) +14 B (+0.30%) +3 B (+0.07%) +10 B (+0.22%)
4 asset(s) this pull request adds
Asset Raw Gzip (9) Brotli (11) Zstd (19)
⚪ added css/export-type-style-runtime-chunk 0/runtime.0.js 6.31 KiB 1.64 KiB 1.43 KiB 1.63 KiB
⚪ added css/export-type-style-runtime-chunk 0/main.0.js 1.32 KiB 552 B 454 B 558 B
⚪ added css/export-type-style-runtime-chunk 1/runtime.1.js 1.14 KiB 642 B 550 B 643 B
⚪ added css/export-type-style-runtime-chunk 1/main.1.js 388 B 294 B 238 B 294 B

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

2 runtime(s) this pull request adds or no longer builds
Runtime Modules
➕ css/export-type-style-runtime-chunk 0/runtime 5
➕ css/export-type-style-runtime-chunk 1/runtime 4

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

@lazerg
lazerg force-pushed the fix/css-style-export-require branch from d8b713c to ab03de4 Compare October 21, 2026 08:47
@codspeed

codspeed Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Merging this PR will improve performance by ×41

2 warnings, 1 note

⚠️ 111 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚠️ Base and head ran on different runner types

Some benchmarks with significant performance changes were compared across different runner types, so the changes might not come from the code. Run base and head on the same runner type, or use CodSpeed Macro Runners for more stable results.

Learn more about Macro Runners

Open the report in CodSpeed to investigate

ℹ️ 47 benchmarks have no flamegraph

The flamegraph wasn't generated: most of the time was spent in runtime internals, which would leave nothing useful to analyze.

See affected benchmarks

⚡ 1 improved benchmark
✅ 338 untouched benchmarks
⏩ 497 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
⚡ Memory benchmark "devtool-eval-source-map", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' 8,057.8 KB 194.3 KB ×41

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing lazerg:fix/css-style-export-require (ab03de4) with main (59e0a49)

Open in CodSpeed

Footnotes

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

@alexander-akait
alexander-akait merged commit e7441b2 into webpack:main Oct 21, 2026
67 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

This PR is packaged and the instant preview of its latest commit is available.

Install it locally:

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

markharding pushed a commit to futo-org/Harbor that referenced this pull request Oct 27, 2026
This PR contains the following updates:

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

---

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

---

### Release Notes

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

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

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

##### Patch Changes

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

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

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

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

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

##### Patch Changes

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

</details>

---

### Configuration

📅 **Schedule**: (UTC)

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

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

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

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

---

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

---

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

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

Labels

area: runtime Emitted runtime and chunk loading across targets (lib/runtime, lib/web, lib/node, lib/esm) regression Worked in a previous release; pair with the Affected version field

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CSS: ExportType: "style" CSS modules are emitted without __webpack_require__ parameter

2 participants