{"id":21981,"library":"rollup-plugin-cssnext","title":"rollup-plugin-cssnext","description":"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.","status":"deprecated","version":"0.1.1","language":"javascript","source_language":"en","source_url":"https://github.com/timdp/rollup-plugin-cssnext","tags":["javascript"],"install":[{"cmd":"npm install rollup-plugin-cssnext","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-cssnext","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-cssnext","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Default export only. Named import will produce undefined.","wrong":"const { cssnext } = require('rollup-plugin-cssnext')","symbol":"cssnext","correct":"import cssnext from 'rollup-plugin-cssnext'"},{"note":"Namespace import results in object with default property.","wrong":"import * as cssnext from 'rollup-plugin-cssnext'","symbol":"cssnext (ESM)","correct":"import cssnext from 'rollup-plugin-cssnext'"},{"note":"CJS exports default as a single function, not a named export.","wrong":"const { cssnext } = require('rollup-plugin-cssnext')","symbol":"cssnext (CJS)","correct":"const cssnext = require('rollup-plugin-cssnext')"}],"quickstart":{"code":"// rollup.config.js\nimport cssnext from 'rollup-plugin-cssnext';\n\nexport default {\n  input: 'src/index.js',\n  output: {\n    file: 'dist/bundle.js',\n    format: 'iife'\n  },\n  plugins: [\n    cssnext({\n      include: '**/*.css',\n      exclude: null,\n      minify: true,\n      dynamic: false,\n      postcssOptions: {},\n      presetEnvOptions: {\n        stage: 2\n      }\n    })\n  ]\n};\n","lang":"javascript","description":"Basic Rollup configuration using rollup-plugin-cssnext to process CSS files via postcss-preset-env with minification."},"warnings":[{"fix":"Migrate to rollup-plugin-postcss with postcss-preset-env as a PostCSS plugin.","message":"Package is unmaintained; postcss-preset-env v7+ requires different plugin setup.","severity":"deprecated","affected_versions":">=0.1.1"},{"fix":"If using PostCSS 8 in other plugins, switch to rollup-plugin-postcss with postcss-preset-env v7+.","message":"PostCSS 8+ compatibility: rollup-plugin-cssnext v0.1.1 uses PostCSS 7 internally.","severity":"breaking","affected_versions":"0.1.1"},{"fix":"When 'dynamic: true' is set, invoke the result as a function: const style = buildCss({}).","message":"Dynamic mode returns a function, not a string. Using the result as a string will fail.","severity":"gotcha","affected_versions":"*"},{"fix":"Ensure patterns match rollup-pluginutils createFilter syntax (e.g., '**/*.css').","message":"Include/exclude patterns use rollup-pluginutils; glob patterns differ from native Rollup filters.","severity":"gotcha","affected_versions":"*"},{"fix":"Ensure CSS imports are handled only in contexts where plugin is active; server-side imports may cause errors.","message":"CSS import returns a string; bundler must handle CSS imports manually or via plugin.","severity":"breaking","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run 'npm install --save-dev rollup-plugin-cssnext'.","cause":"Package not installed or devDependency not installed.","error":"Cannot find module 'rollup-plugin-cssnext'"},{"fix":"Use 'import cssnext from 'rollup-plugin-cssnext'' or 'const cssnext = require('rollup-plugin-cssnext')'.","cause":"Probably imported as named export instead of default.","error":"TypeError: cssnext is not a function"},{"fix":"Downgrade postcss-preset-env to v6 or switch to rollup-plugin-postcss.","cause":"rollup-plugin-cssnext v0.1.1 uses PostCSS 7, which is incompatible with postcss-preset-env v7+.","error":"Error: PostCSS plugin postcss-preset-env requires PostCSS 8."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}