{"_id":"@bonsaicss/rollup-plugin","_rev":"2-18cd6acd75787d55145b3051aff7b25e","name":"@bonsaicss/rollup-plugin","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@bonsaicss/rollup-plugin","version":"0.1.0","keywords":["css","rollup","rollup-plugin","pruner","bonsaicss"],"license":"MIT","_id":"@bonsaicss/rollup-plugin@0.1.0","maintainers":[{"name":"menesesevandro","email":"evandro.m.carneiro@gmail.com"}],"dist":{"shasum":"6a8078eb49bc87d2d2643e02763bd0a131828836","tarball":"https://registry.npmjs.org/@bonsaicss/rollup-plugin/-/rollup-plugin-0.1.0.tgz","fileCount":8,"integrity":"sha512-zSQVQyUiV0QCr7SknFpV8j1Kj2GPv1DCh8T/KZEM0a4i7KVtZN/TvbWxgv6eh5KflBd6OQNfDCYBxfNyF96jHw==","signatures":[{"sig":"MEYCIQDmCxLz/0fCBbkuTtTMWE4YgfY7wQUG9fEFvJZUDOBeqgIhAMaBSlCa8hq/DIwXrYSQy2pdWibCuwS1O06oMixTRApq","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14945},"main":"./dist/index.cjs","type":"module","_from":"file:bonsaicss-rollup-plugin-0.1.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"tsup --watch","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"menesesevandro","email":"evandro.m.carneiro@gmail.com"},"_resolved":"/private/var/folders/qb/vlwc873j797133xp2sb8d7tr0000gn/T/84228ec60a751ece563adcd6becd5c6e/bonsaicss-rollup-plugin-0.1.0.tgz","_integrity":"sha512-zSQVQyUiV0QCr7SknFpV8j1Kj2GPv1DCh8T/KZEM0a4i7KVtZN/TvbWxgv6eh5KflBd6OQNfDCYBxfNyF96jHw==","_npmVersion":"11.10.0","description":"BonsaiCSS Rollup plugin — prune unused CSS during Rollup builds 🌳","directories":{},"_nodeVersion":"24.8.0","dependencies":{"@bonsaicss/core":"0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"rollup":"^4.0.0"},"peerDependencies":{"rollup":"^3.0.0 || ^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/rollup-plugin_0.1.0_1771197848725_0.4800481119533051","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@bonsaicss/rollup-plugin","version":"0.1.1","description":"BonsaiCSS Rollup plugin — prune unused CSS during Rollup builds 🌳","repository":{"type":"git","url":"git+https://github.com/Bonsai-CSS/bonsaicss.git","directory":"packages/bonsaicss-rollup-plugin"},"publishConfig":{"access":"public"},"license":"MIT","type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"dependencies":{"@bonsaicss/core":"0.1.1"},"peerDependencies":{"rollup":"^3.0.0 || ^4.0.0"},"devDependencies":{"rollup":"^4.0.0"},"keywords":["css","rollup","rollup-plugin","pruner","bonsaicss"],"scripts":{"build":"tsup","dev":"tsup --watch","typecheck":"tsc --noEmit"},"_id":"@bonsaicss/rollup-plugin@0.1.1","bugs":{"url":"https://github.com/Bonsai-CSS/bonsaicss/issues"},"homepage":"https://github.com/Bonsai-CSS/bonsaicss#readme","_integrity":"sha512-NHLD/hticY8xoX9rIOf/RshF3uFNZbx1Evs0Zyu5uhAKNe7ZK0ulSvbTtOoSWBtXKN+IpEgUlQJOmBPs9KDRpw==","_resolved":"/private/var/folders/qb/vlwc873j797133xp2sb8d7tr0000gn/T/9c7211e8de5d5cf3a4f0e24cef281f8f/bonsaicss-rollup-plugin-0.1.1.tgz","_from":"file:bonsaicss-rollup-plugin-0.1.1.tgz","_nodeVersion":"24.8.0","_npmVersion":"11.10.0","dist":{"integrity":"sha512-NHLD/hticY8xoX9rIOf/RshF3uFNZbx1Evs0Zyu5uhAKNe7ZK0ulSvbTtOoSWBtXKN+IpEgUlQJOmBPs9KDRpw==","shasum":"797d76b183b7224c245d540b51f4954a48339744","tarball":"https://registry.npmjs.org/@bonsaicss/rollup-plugin/-/rollup-plugin-0.1.1.tgz","fileCount":8,"unpackedSize":15097,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCID2yVO2mQjLG0aSoGu4K77xbcQGjZk212bl9L2R74novAiAKbqYmLhHIyz2vM7fLO02id29MBpjan97S4D0jSIWkUg=="}]},"_npmUser":{"name":"menesesevandro","email":"evandro.m.carneiro@gmail.com"},"directories":{},"maintainers":[{"name":"menesesevandro","email":"evandro.m.carneiro@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/rollup-plugin_0.1.1_1771258780703_0.15761368057756875"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-15T23:24:08.655Z","modified":"2026-02-16T16:19:40.965Z","0.1.0":"2026-02-15T23:24:08.866Z","0.1.1":"2026-02-16T16:19:40.850Z"},"license":"MIT","keywords":["css","rollup","rollup-plugin","pruner","bonsaicss"],"description":"BonsaiCSS Rollup plugin — prune unused CSS during Rollup builds 🌳","maintainers":[{"name":"menesesevandro","email":"evandro.m.carneiro@gmail.com"}],"readme":"# @bonsaicss/rollup-plugin\n\n> Rollup / Vite plugin for BonsaiCSS 🌳 — prune unused CSS during Rollup builds.\n\n## Installation\n\n```bash\nnpm install @bonsaicss/rollup-plugin rollup\n```\n\n## Setup\n\n### rollup.config.js\n\n```js\nimport bonsaiRollup from '@bonsaicss/rollup-plugin';\n\nexport default {\n  input: 'src/index.js',\n  plugins: [\n    bonsaiRollup({\n      content: ['./src/**/*.{html,tsx,jsx,vue,svelte}'],\n    }),\n  ],\n};\n```\n\n### With Vite\n\n```ts\n// vite.config.ts\nimport { defineConfig } from 'vite';\nimport bonsaiRollup from '@bonsaicss/rollup-plugin';\n\nexport default defineConfig({\n  plugins: [\n    bonsaiRollup({\n      content: ['./src/**/*.{html,tsx,jsx,vue,svelte}'],\n    }),\n  ],\n});\n```\n\n## Options\n\n| Option | Type | Default | Description |\n|---|---|---|---|\n| `content` | `string[]` | — | **Required.** Glob patterns for content files to scan. |\n| `extensions` | `string[]` | `['.css']` | File extensions to process. |\n| `verbose` | `boolean` | `false` | Log pruning statistics to stderr. |\n| `safelist` | `string[]` | `[]` | Class names to always keep. |\n| `safelistPatterns` | `(string \\| RegExp)[]` | `[]` | Regex patterns for classes to preserve. |\n| `keepDynamicPatterns` | `boolean \\| (string \\| RegExp)[]` | `false` | Infer or provide dynamic class patterns. |\n\n## How It Works\n\nThe plugin uses two Rollup hooks:\n\n- **`buildStart`** — Invalidates the scan cache at the start of each build for fresh scanning.\n- **`transform`** — Intercepts CSS files (by extension), prunes them against scanned content, and returns the optimized CSS.\n\nThe scan is lazily initialized on the first CSS file and shared across all CSS files in the build.\n\n## License\n\nMIT\n","readmeFilename":"README.md","homepage":"https://github.com/Bonsai-CSS/bonsaicss#readme","repository":{"type":"git","url":"git+https://github.com/Bonsai-CSS/bonsaicss.git","directory":"packages/bonsaicss-rollup-plugin"},"bugs":{"url":"https://github.com/Bonsai-CSS/bonsaicss/issues"}}