Webpack 5 plugin that processes generated CSS assets with PostCSS pipelines, enabling multi-file transformations like critical CSS extraction and minification where loaders fall short. Version 6.0.0 (latest) requires Node >=10 and webpack ^5; for webpack 4 use v5, for webpack 3 use v3. Key differentiator: processes all generated CSS files (including those from plugins like MiniCssExtractPlugin) through PostCSS plugins in a pipeline, with support for custom filters, naming (prefix, suffix, transformName), and source maps. Supports PostCSS 6, 7, 8.0.
npm install postcss-pipeline-webpack-pluginVerified import paths — ran on the pinned version, not inferred.
Sets up PostCSS pipeline to minify all extracted CSS files using csso, adding a '.min' suffix and generating source maps.
Upgrade Node.js to >=4.7 or use postcss-pipeline-webpack-plugin@1.x.
Use postcss-pipeline-webpack-plugin@5 for webpack 4, or @3 for webpack 3.
const postcss = require('postcss'); new PostCssPipelineWebpackPlugin({ processor: postcss([plugin]) });Consult PostCSS source map documentation for appropriate options.
Ensure you use 'new PostCssPipelineWebpackPlugin({...})' and not the class itself.Run 'npm install postcss --save-dev' to install PostCSS.
Import the plugin: const criticalSplit = require('postcss-critical-split');