Skip to content

docs(compilation-hooks): document CssModulesPlugin.getCompilationHooks() and orderModules#8248

Merged
alexander-akait merged 1 commit into
mainfrom
docs/css-order-modules-hook
May 19, 2026
Merged

docs(compilation-hooks): document CssModulesPlugin.getCompilationHooks() and orderModules#8248
alexander-akait merged 1 commit into
mainfrom
docs/css-order-modules-hook

Conversation

@bjohansebas
Copy link
Copy Markdown
Member

Summary

Webpack 5.107 adds a new orderModules hook on CssModulesPlugin.getCompilationHooks(compilation). It is a SyncBailHook<[Chunk, Module[], Compilation], Module[] | undefined> called once per CSS source type (CSS imports and CSS modules) with the chunk's modules pre-sorted by full module name, letting plugin authors override the default import-order topological sort and side-step the Conflicting order between css ... warning.

Adds a new section at the end of api/compilation-hooks.mdx documenting both the CssModulesPlugin.getCompilationHooks() entry point and the orderModules hook itself, following the pattern already used in the file for NormalModule.getCompilationHooks().loader.

Refs: webpack/webpack#20978

Test plan

  • Visual check of the new section at the end of compilation-hooks
  • Verify the code example renders correctly
  • Verify the badge shows "5.107.0+"

Use of AI

Drafted with Claude under human review. The contributor verified each change against the upstream webpack PR before commit.

…s() and orderModules

Webpack 5.107 adds a new orderModules hook on
CssModulesPlugin.getCompilationHooks(compilation). It is a SyncBailHook
called once per CSS source type (CSS_IMPORT_TYPE and CSS_TYPE) with the
chunk's modules pre-sorted by full module name, letting plugin authors
override the default import-order topological sort and side-step the
"Conflicting order between css ..." warning.

Adds a new section at the end of compilation-hooks.mdx documenting both
the CssModulesPlugin.getCompilationHooks() entry point and the
orderModules hook itself, following the pattern already used in the
file for NormalModule.getCompilationHooks().loader.

Refs: webpack/webpack#20978
@vercel
Copy link
Copy Markdown

vercel Bot commented May 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
webpack-js-org Ready Ready Preview, Comment May 19, 2026 2:54pm

Request Review

@alexander-akait alexander-akait merged commit b2c1e64 into main May 19, 2026
10 checks passed
@alexander-akait alexander-akait deleted the docs/css-order-modules-hook branch May 19, 2026 15:17
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.

2 participants