-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request]align rspack plugin with webpack plugin #377
Comments
I agree. This logic is flawed and i could be really easy, because rspack handles css out of the box and it is not even necessary to specify it (https://www.rspack.dev/guide/migrate-from-webpack.html#removing-css-loader-style-loader-and-mini-css-extract-plugin). Even if it is specified, setting to undefined didn't work in my tests, but you can just set the type to 'css/auto' and rspack will handle style files without ".module" in the name as normal css and files with ".module" in the name as css modules (https://www.rspack.dev/guide/language-support.html#css). The situation gets worse, when you use withReact instead of withWeb, because withReact loads withWeb internally and forces cssModules, no matter what you pass in as options ->
All of this should be fixed and configurable, so we don't need to crawl deep into the sourcecode to understand, why the bundling behaves weird. |
There are many rspack config that is compatible with webpack, it's great if rspack plugin align with webpack plugin.
I find that rspack plugin use
cssModules
option to determine how css module work, but webpack plugin define two loader rules to sperately handle global css and css module. It result hard to migrate to rspack from webpackin rspack plugin
nx-labs/packages/rspack/src/utils/with-web.ts
Lines 47 to 98 in 271625e
in webpack plugin
https://github.com/nrwl/nx/blob/a1d8645ac57864ba1a7347b9f288f3052aba2263/packages/webpack/src/plugins/nx-webpack-plugin/lib/apply-web-config.ts#L128-L243
The text was updated successfully, but these errors were encountered: