CssExtractRspackPlugin
Rspack is currently incompatible with mini-css-extract-plugin, but you can use the CssExtractRspackPlugin as a replacement. It can be used with css-loader to extract CSS into separate files.
If your project does not depend on on css-loader and mini-css-extract-plugin, it is recommended to use Rspack's built-in CSS solution experiments.css, which offers better performance.
Example
When using CssExtractRspackPlugin, you need to register the plugin in the plugins section and register CssExtractRspackPlugin.loader in module.rules.
Plugin options
Options for CssExtractRspackPlugin.
- Types:
Loader options
Options for CssExtractRspackPlugin.loader.
- Types:
Note
Please note when enabling the built-in CSS support (experiments.css), Files ending with .css will be automatically treated as css/auto modules. If you want to use this plugin, make sure that the rule types with CssExtractRspackPlugin.loader set are all overridden by javascript/auto instead of the default css/auto.
For example:

