Registry / devops / rollup-plugin-cssnext

rollup-plugin-cssnext

JSON →
library0.1.1jsnpmunverified

Rollup plugin for processing CSS files with postcss-preset-env. Current stable version 0.1.1 (last release 2018). Unmaintained: postcss-preset-env v7+ requires different plugin setup. Replaced by rollup-plugin-postcss with postcss-preset-env. Features include CSS minification via cssnano, dynamic CSS variable injection, and include/exclude filters. No TypeScript support, requires Node >=8.

npm install rollup-plugin-cssnext
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-CSSN
R
rollup-plugin-cssnext
devopsjavascriptv0.1.1
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.

cssnext
import cssnext from 'rollup-plugin-cssnext'
const { cssnext } = require('rollup-plugin-cssnext')
Default export only. Named import will produce undefined.
cssnext (ESM)
import cssnext from 'rollup-plugin-cssnext'
import * as cssnext from 'rollup-plugin-cssnext'
Namespace import results in object with default property.
cssnext (CJS)
const cssnext = require('rollup-plugin-cssnext')
const { cssnext } = require('rollup-plugin-cssnext')
CJS exports default as a single function, not a named export.

Basic Rollup configuration using rollup-plugin-cssnext to process CSS files via postcss-preset-env with minification.

// rollup.config.js import cssnext from 'rollup-plugin-cssnext'; export default { input: 'src/index.js', output: { file: 'dist/bundle.js', format: 'iife' }, plugins: [ cssnext({ include: '**/*.css', exclude: null, minify: true, dynamic: false, postcssOptions: {}, presetEnvOptions: { stage: 2 } }) ] };
Debug
Known issues
deprecatedPackage is unmaintained; postcss-preset-env v7+ requires different plugin setup.
fix
Migrate to rollup-plugin-postcss with postcss-preset-env as a PostCSS plugin.
affects: >=0.1.1
breakingPostCSS 8+ compatibility: rollup-plugin-cssnext v0.1.1 uses PostCSS 7 internally.
fix
If using PostCSS 8 in other plugins, switch to rollup-plugin-postcss with postcss-preset-env v7+.
affects: 0.1.1
gotchaDynamic mode returns a function, not a string. Using the result as a string will fail.
fix
When 'dynamic: true' is set, invoke the result as a function: const style = buildCss({}).
affects: *
gotchaInclude/exclude patterns use rollup-pluginutils; glob patterns differ from native Rollup filters.
fix
Ensure patterns match rollup-pluginutils createFilter syntax (e.g., '**/*.css').
affects: *
breakingCSS import returns a string; bundler must handle CSS imports manually or via plugin.
fix
Ensure CSS imports are handled only in contexts where plugin is active; server-side imports may cause errors.
affects: *
Errors
Common errors & fixes
Cannot find module 'rollup-plugin-cssnext'
Package not installed or devDependency not installed.
fix
Run 'npm install --save-dev rollup-plugin-cssnext'.
TypeError: cssnext is not a function
Probably imported as named export instead of default.
fix
Use 'import cssnext from 'rollup-plugin-cssnext'' or 'const cssnext = require('rollup-plugin-cssnext')'.
Error: PostCSS plugin postcss-preset-env requires PostCSS 8.
rollup-plugin-cssnext v0.1.1 uses PostCSS 7, which is incompatible with postcss-preset-env v7+.
fix
Downgrade postcss-preset-env to v6 or switch to rollup-plugin-postcss.
Upgrade
Version history
0.1.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
Resources
rollup-plugin-cssnext — npm install rollup-plugin-cssnext · libregistry