{"library":"rollup-plugin-purgecss","title":"rollup-plugin-purgecss","description":"Rollup plugin to remove unused CSS using PurgeCSS. Current stable version 8.0.0. Part of the PurgeCSS monorepo, releases follow PurgeCSS core releases. Key differentiator: tree-shaking CSS in Rollup bundles based on content analysis, supporting safelisting, extractors, and CSS variables. Compatible with Rollup 2+, ESM-first with TypeScript types. Regular releases with breaking changes across major versions. Alternative to cssnano and uncss for unused CSS removal.","language":"javascript","status":"active","last_verified":"Mon Apr 27","install":{"commands":["npm install rollup-plugin-purgecss"],"cli":null},"imports":["import purgecss from 'rollup-plugin-purgecss';","import type { PurgecssOptions } from 'rollup-plugin-purgecss';","import PurgeCSS from 'purgecss';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { rollup } from 'rollup';\nimport purgecss from 'rollup-plugin-purgecss';\n\nawait rollup({\n  input: 'src/main.js',\n  plugins: [\n    purgecss({\n      content: ['index.html', 'src/**/*.js'],\n      safelist: {\n        standard: ['safelisted-class'],\n        deep: [/^safelisted-/],\n        greedy: [/^greedy-/]\n      },\n      variables: true\n    })\n  ],\n  output: {\n    dir: 'dist',\n    format: 'es'\n  }\n});","lang":"typescript","description":"Basic Rollup configuration using purgecss plugin with safelist and CSS variable removal.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}