Registry / web-framework / rollup-plugin-postcss-umi

rollup-plugin-postcss-umi

JSON →
library2.0.3jsnpmunverified

Seamlessly integrates PostCSS with Rollup. Version 2.0.3 supports Rollup 1.0+ and processes CSS, SASS, Stylus, and Less files. It injects CSS into <head> by default, supports CSS modules, and can extract CSS to file. Differentiators include local PostCSS config auto-detection and node_modules resolution for Sass imports. Released with monthly cadence, maintained by egoist. ESM-only import.

npm install rollup-plugin-postcss-umi
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-POST
R
rollup-plugin-postcss-umi
web-frameworkjavascriptv2.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-umi'
const postcss = require('rollup-plugin-postcss-umi')
Package is ESM-only from v2; CommonJS require will fail.
postcss (CJS usage)
const postcss = require('rollup-plugin-postcss-umi').default
const postcss = require('rollup-plugin-postcss-umi')
If using require() in legacy setups, access .default property.
TypeScript types
import postcss from 'rollup-plugin-postcss-umi'
import postcss = require('rollup-plugin-postcss-umi')
TypeScript users should use default import; types are included.

Basic Rollup config integrating PostCSS with extraction and CSS modules auto-detection.

// rollup.config.js import postcss from 'rollup-plugin-postcss-umi'; export default { input: 'src/index.js', output: { file: 'dist/bundle.js', format: 'cjs' }, plugins: [ postcss({ plugins: [], // Enable CSS modules for .module.css files autoModules: true, // Extract CSS to separate file extract: true }) ] };
Debug
Known issues
breakingv2.0 drops support for Rollup 0.x; only Rollup 1.0 and above are supported.
fix
Upgrade Rollup to 1.0+.
affects: >=2.0
gotchaWhen extract: true, CSS is not injected into <head>; inject option is forced to false.
fix
If you need both injection and extraction, handle manually or use a separate plugin.
affects: >=0.0.0
gotchaNamed exports for CSS modules use a transformation that replaces dashes with $ wrapped underscores, which may cause unexpected export names.
fix
Supply a custom namedExports function to control naming.
affects: >=0.0.0
deprecatedThe package name includes 'umi' but has no direct relation to UmiJS; consider using rollup-plugin-postcss for clarity.
fix
Use the official rollup-plugin-postcss package if compatibility with other tools is preferred.
affects: >=0.0.0
Errors
Common errors & fixes
Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'rollup-plugin-postcss-umi'
Using CommonJS require() on an ESM-only package.
fix
Use import statement or require with .default: const postcss = require('rollup-plugin-postcss-umi').default
TypeError: postcss is not a function
Importing package but mistakenly treating it as a default export when it is an object, or using wrong rollup config format.
fix
Ensure you call postcss({...}) not just postcss, and pass as a plugin in an array.
Error: The 'postcss' plugin is not found. Did you install 'postcss'?
PostCSS is a peer dependency and not automatically installed.
fix
Run npm install postcss --dev beside rollup-plugin-postcss-umi.
Upgrade
Version history
2.0.3latest on npm
Audit
Dependencies
postcssrequiredCore dependency for CSS processing.
rolluprequiredPeer dependency; plugin works only with Rollup 1.0+.
Agent activity
6 hits · last 30 days
node
4
OpenAI (training)
2
Resources
rollup-plugin-postcss-umi — npm install rollup-plugin-postcss-umi · libregistry