CssExtractRspackPlugin
Rspack only
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, 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.
rspack.config.mjs
Plugin options
Options for CssExtractRspackPlugin.
- Types:
Loader options
Options for CssExtractRspackPlugin.loader.
- Types:
Note
Please note that if you want to use this plugin and css together, it's recommended to explicitly set type to javascript/auto.
For example:
rspack.config.mjs

