Registry / devops / rollup-plugin-postcss-export

rollup-plugin-postcss-export

JSON →
library1.0.3jsnpmunverified

A Rollup plugin that integrates PostCSS processing and bundles processed CSS into a single external file. Version 1.0.3 is the latest stable release. Features include custom PostCSS plugins, source maps, CSS modules support via postcss-modules, and configurable file extensions. Key differentiators: it exports all CSS to one external file rather than inlining or emitting separate chunks, and it supports CSS modules with a getExport callback. The plugin is lightweight and focused, but has low maintenance activity.

npm install rollup-plugin-postcss-export
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-POST
R
rollup-plugin-postcss-export
devopsjavascriptv1.0.3
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

postcss
import postcss from 'rollup-plugin-postcss-export'
const postcss = require('rollup-plugin-postcss-export');
ESM-only; default export.
postcss (default)
import postcss from 'rollup-plugin-postcss-export'
import { postcss } from 'rollup-plugin-postcss-export'
Do not use named import; plugin is default-exported.
TypeScript type
import type { PostCSSPluginOptions } from 'rollup-plugin-postcss-export'
import { PostCSSPluginOptions } from 'rollup-plugin-postcss-export'
Type imports are available; avoid runtime import of types.

Minimal Rollup config using rollup-plugin-postcss-export to process CSS and export a single external CSS file with autoprefixer and source maps.

import postcss from 'rollup-plugin-postcss-export'; export default { input: 'src/main.js', output: { dir: 'dist', format: 'es' }, plugins: [ postcss({ plugins: [require('autoprefixer')], sourceMap: true, export: './dist/bundle.css', }), ], };
Debug
Known issues
gotchaThe 'export' option must be a path relative to Rollup's output directory, not an absolute path. Misconfigured paths lead to missing CSS output.
fix
Use './output.css' instead of '/absolute/path/output.css'.
affects: >=1.0.0
gotchaThe plugin only processes CSS imported via JavaScript (import 'style.css'). It does not include CSS from <link> tags or HTML files.
fix
Ensure all CSS is imported in your JS entry points or use additional plugins for HTML.
affects: >=1.0.0
deprecatedThe 'postcss' option to pass a PostCSS instance directly is deprecated. Use the 'plugins' array instead.
fix
Replace 'postcss: require('postcss')' with 'plugins: [...]'.
affects: >=1.0.0
gotchaCSS modules (via postcss-modules) require manual export mapping; the plugin does not handle it automatically.
fix
Implement 'getJSON' in postcss-modules config and a 'getExport' function in the plugin options.
affects: >=1.0.0
gotchaThe plugin does not support 'use' or 'inject' options; all CSS is exported to an external file only.
fix
Use alternative plugins like rollup-plugin-postcss if you need to inject CSS or bundle inline.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: postcss is not a function
Incorrect import: using named import instead of default.
fix
Change to 'import postcss from 'rollup-plugin-postcss-export'
Error: Cannot find module 'rollup-plugin-postcss-export'
Missing npm dependencies or incorrect package name.
fix
Run 'npm install rollup-plugin-postcss-export' and ensure no typos.
Error: The 'export' option is required if you want to output a file.
Missing 'export' option in plugin config.
fix
Add 'export: './bundle.css'' to the postcss options.
TypeError: Cannot read property 'id' of undefined
CSS import not resolved or plugin not applied before other plugins.
fix
Ensure plugin is early in the plugins array and imports have correct paths.
Upgrade
Version history
1.0.3latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
rollup-plugin-postcss-export — npm install rollup-plugin-postcss-export · libregistry