{"library":"rollup-plugin-lib-style","title":"Rollup Plugin Lib Style","description":"A Rollup plugin for building component libraries with tree-shakeable, per-component CSS. Version 2.5.0 (stable). It converts CSS and preprocessor files (SASS/SCSS, Less, Stylus) into CSS modules, generating a separate CSS file per component with scoped class names. Unlike single CSS file bundling (bloat) or CSS-in-JS (runtime overhead), this plugin outputs plain CSS with zero runtime cost and automatic scoping. Works with preserveModules and code splitting. ESM-only, requires Node >=16. Ships TypeScript types.","language":"javascript","status":"active","last_verified":"Mon Apr 27","install":{"commands":["npm install rollup-plugin-lib-style"],"cli":null},"imports":["import { libStylePlugin } from 'rollup-plugin-lib-style'","import libStylePlugin from 'rollup-plugin-lib-style'","import type { LibStylePluginOptions } from 'rollup-plugin-lib-style'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// rollup.config.js\nimport { libStylePlugin } from 'rollup-plugin-lib-style';\n\nexport default {\n  input: 'src/index.js',\n  output: {\n    dir: 'dist',\n    format: 'es',\n    preserveModules: true\n  },\n  plugins: [\n    libStylePlugin({\n      // Optional: custom postcss config\n      postcss: {\n        modules: true\n      }\n    })\n  ]\n};\n\n// src/components/Button.js\nimport styles from './Button.css';\n\nconst Button = () => {\n  const button = document.createElement('button');\n  button.className = styles.button;\n  button.textContent = 'Click me';\n  return button;\n};\n\nexport default Button;","lang":"typescript","description":"Shows minimal Rollup config with preserveModules, CSS module usage, and plugin setup.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}