Webpack loader for CSS minification using CSSO. Current stable version is 0.3.1, with basic support for CSSO's restructure, comments, debug, and usage options. This loader allows inline query parameters or a top-level 'csso' config object. It works with webpack 1.x (loaders array) and has limited updates since last release; modern webpack versions may require a different loader syntax. It integrates after css-loader to minify CSS output.
npm install csso-loaderVerified import paths — ran on the pinned version, not inferred.
Minimal webpack config using csso-loader after css-loader to minify CSS files.
For webpack 2+, replace 'loaders' with 'rules' and use 'loaderOptionsPlugin' to pass options or switch to style-loader / css-loader built-in minification.
Either use query parameters in the loader string, or add 'csso' as a top-level key in webpack config.
Always use 'css-loader!csso-loader' in loader string so csso-loader receives already-parsed CSS.
Pin csso version to 3.x or migrate to a modern minifier like css-minimizer-webpack-plugin.
Disable CSS modules for the rule targeted by csso-loader, or use a different minifier.
Wrap csso options in new webpack.LoaderOptionsPlugin({ options: { csso: { restructure: false } } }) and apply to the correct loaders.Install csso as a devDependency: npm install csso --save-dev