{"id":22238,"library":"rollup-plugin-styler","title":"rollup-plugin-styler","description":"Universal Rollup plugin for processing CSS, PostCSS, Sass, Less, Stylus, and CSS Modules with asset handling and URL resolving. Current stable version is 2.0.0 (released 2025-02-09), with a new major version that resets stylus dependency. Key differentiators: supports multiple preprocessors, CSS Modules type exports, inject/extract/emit modes, and automatic PostCSS config loading. Actively maintained, with recent updates focusing on dependency upgrades and CI improvements.","status":"active","version":"2.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/plumelo/rollup-plugin-styler","tags":["javascript","rollup","rollup-plugin","css","css-modules","postcss","sass","scss","less","typescript"],"install":[{"cmd":"npm install rollup-plugin-styler","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-styler","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-styler","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency, required for plugin to work","package":"rollup","optional":false}],"imports":[{"note":"ESM-only, CommonJS require not supported","wrong":"const styles = require('rollup-plugin-styler')","symbol":"default","correct":"import styles from 'rollup-plugin-styler'"},{"note":"Type import only, not a runtime object","wrong":"import { RollupPluginStylerOptions } from 'rollup-plugin-styler'","symbol":"RollupPluginStylerOptions","correct":"import type { RollupPluginStylerOptions } from 'rollup-plugin-styler'"},{"note":"Available in v2.0.0 for configuring CSS injection","symbol":"InjectOptions","correct":"import type { InjectOptions } from 'rollup-plugin-styler'"}],"quickstart":{"code":"import styles from 'rollup-plugin-styler';\n\nexport default {\n  input: 'src/index.js',\n  output: {\n    dir: 'dist',\n    format: 'esm',\n    assetFileNames: '[name]-[hash][extname]'\n  },\n  plugins: [\n    styles({\n      mode: 'extract',\n      sass: {\n        indentedSyntax: true\n      }\n    })\n  ]\n};","lang":"typescript","description":"Rollup config with rollup-plugin-styler in extract mode with Sass support."},"warnings":[{"fix":"Update stylus usage to match the new version.","message":"v2.0.0 resets stylus version, potentially breaking if relying on older stylus features","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Use 'rollup-plugin-styler' instead of 'rollup-styles'.","message":"The package was renamed from 'rollup-styles' to 'rollup-plugin-styler' in v1.6.0; imports from the old name will fail","severity":"breaking","affected_versions":">=1.6.0"},{"fix":"Switch to 'inject' or 'extract' mode.","message":"Mode 'emit' may be removed in future versions; consider using 'inject' or 'extract'","severity":"deprecated","affected_versions":"<2.0.0"},{"fix":"Set mode: 'extract' in plugin options.","message":"Default mode is 'inject', which embeds CSS in JS. Use 'extract' mode to output separate CSS files","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use `import { css } from './style.css'` for CSS string.","message":"When using CSS Modules, import { css } instead of default export; default export returns a style object for injection","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"npm install -D rollup-plugin-styler and update imports.","cause":"Package renamed to rollup-plugin-styler","error":"Error: Cannot find module 'rollup-styles'"},{"fix":"npm install -D postcss","cause":"PostCSS is required when using PostCSS features","error":"Error: Cannot find module 'postcss'"},{"fix":"Use `import styles from 'rollup-plugin-styler'` instead of `require`.","cause":"CommonJS require used instead of ESM import","error":"TypeError: styles is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}