Webpack loader that processes CSS with PostCSS. Current stable version is 8.2.1, released February 2026, requiring Node.js >=18.12.0 and webpack ^5.0.0. Supports automatic configuration file discovery (postcss.config.js, etc.) and ESM configs via jiti v2. Key differentiator: official webpack integration for PostCSS, handles source maps, CSS-in-JS via execute option, and supports Rspack as optional peer dependency.
npm install postcss-loaderVerified import paths — ran on the pinned version, not inferred.
Install required dependencies and configure postcss-loader in webpack to process CSS with PostCSS plugins.
Upgrade Node.js to 18.12.0 or higher
Upgrade webpack to v5 or downgrade postcss-loader to v4
Ensure jiti v2 is compatible with your config; test ESM load
Use 'postcssOptions' field instead of 'config'
Add execute: true and postcssOptions.parser: 'postcss-js' in loader options
Enable sourceMap in css-loader options and set devtool in webpack config
Create a postcss.config.js file at project root or specify plugins via postcssOptions in webpack config
Install postcss@8: npm install --save-dev postcss@8
Downgrade to postcss-loader@4 or upgrade webpack to v5
Set mode in webpack config: module.exports = { mode: 'development', ... }