A Rollup plugin that seamlessly integrates PostCSS processing into your build pipeline, supporting CSS imports, CSS modules, Sass/Stylus/Less preprocessors, and CSS extraction. Version 3.0.9 is current stable, requires Rollup v2, and uses the modern Sass API to avoid deprecation warnings. It ships TypeScript types and defaults to injecting CSS into the DOM. Key differentiators: simple setup, automatic local PostCSS config detection, and support for CSS-in-JS via style export.
npm install rollup-postcssNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Minimal setup to process CSS with PostCSS and inject into HTML head via Rollup.
Use Rollup v2 and provide absolute paths for extract option or paths relative to bundle output.
Upgrade to v3 for Rollup v2 compatibility.
Set inject:false if you want to handle CSS injection yourself.
Use '@import "~bootstrap/dist/css/bootstrap";' in your .scss files.
Set autoModules: false to disable automatic CSS modules.
Upgrade to rollup-postcss@3 which uses the modern sass API.
Use an absolute path or a path relative to the output file, e.g., extract: path.resolve('dist/my.css').Install postcss: npm install --save-dev postcss
Ensure you are using the plugin within a rollup.config.js or programmatic Rollup build.