A webpack plugin that extracts CSS from chunks into separate stylesheets with Hot Module Replacement (HMR) support. Current stable version is 4.10.0 (last released November 2020). It is a fork/enhancement of mini-css-extract-plugin, adding HMR and SSR compatibility. Supports Webpack 4 and 5, ships TypeScript declarations, and is designed for code-splitting applications. Key differentiator: built-in HMR for extracted CSS files without additional loaders, and chunk-based CSS extraction for universal (SSR) apps. Active maintenance status as of 2020, but no recent releases.
npm install extract-css-chunks-webpack-pluginVerified import paths — ran on the pinned version, not inferred.
Basic webpack config showing usage of ExtractCssChunks plugin with its loader, including HMR option and CSS extraction in production.
Set options.hmr to false or omit it in production, or use webpack mode differentiation.
Set output.publicPath to '/' or your CDN URL.
Replace with mini-css-extract-plugin if HMR not required.
Ensure you are using a compatible version; test with Webpack 5 explicitly.
Upgrade to v4.8.0+ which fixes Safari render blocking.
Run `npm install extract-css-chunks-webpack-plugin --save-dev` or `yarn add extract-css-chunks-webpack-plugin --dev`.
Upgrade extract-css-chunks-webpack-plugin to v4.10.0 or later, which supports Webpack 5.
Check plugin options: use 'filename' and 'chunkFilename' strings (not functions).
Ensure rules for .css files include ExtractCssChunks.loader before css-loader.