Skip to content

feat: allow user-supplied loader/plugin to handle *.module.css - #1404

Open
ishristov wants to merge 1 commit into
egoist:mainfrom
ishristov:fix/allow-module-css-loader
Open

feat: allow user-supplied loader/plugin to handle *.module.css#1404
ishristov wants to merge 1 commit into
egoist:mainfrom
ishristov:fix/allow-module-css-loader

Conversation

@ishristov

@ishristov ishristov commented Jul 8, 2026

Copy link
Copy Markdown

The built-in postcss plugin registers onLoad({ filter: /\.css$/ }, ...), which greedily claims every .css file - including .module.css. This prevents users from wiring esbuild's native local-css loader (or any custom plugin) for CSS Modules via esbuildOptions.

With this change, we can bail early in the postcss onLoad handler when the file ends in .module.css, so downstream plugins/loaders can pick it up. No behavior change unless the user has explicitly configured a .module.css handler themselves.

The built-in postcss plugin registers onLoad({ filter: /\.css$/ }, ...), which greedily claims every .css file — including .module.css. This prevents users from wiring esbuild's native local-css loader (or any custom plugin) for CSS Modules via esbuildOptions.

With this change, we can bail early in the postcss onLoad handler when the file ends in .module.css, so downstream plugins/loaders can pick it up. No behavior change unless the user has explicitly configured a .module.css handler themselves.
@codesandbox

codesandbox Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the EGOIST's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant