@functionalcss/postcss
v0.1.3
Published
FCSS PostCSS plugin — source scanning and production purge
Readme
@functionalcss/postcss
PostCSS plugin that removes unused FCSS utilities by statically scanning your source files.
Installation
npm install -D @functionalcss/postcssUsage
// postcss.config.mjs
import { createRequire } from 'node:module';
import fcss from '@functionalcss/postcss';
const require = createRequire(import.meta.url);
export default {
plugins: [
fcss({
manifest: require.resolve('@functionalcss/core/manifest.json'),
content: ['src/**/*.{html,ts,tsx}'],
}),
],
};Options
| Option | Type | Description |
| ------------ | ------------------------------------------------------- | ------------------------------------------- |
| manifest | string (required) | Path to @functionalcss/core/manifest.json |
| content | string[] (required) | Globs of files to scan for class names |
| cwd | string | Base directory for content globs |
| safelist | { exact?: string[]; patterns?: (string \| RegExp)[] } | Classes always kept |
| report | boolean \| 'json' | Print a purge report |
| reportPath | string | Where to write the JSON report |
Using Vite, Next.js or Astro? Use @functionalcss/vite, @functionalcss/next or
@functionalcss/astro instead — they wire this up for you.
License
MIT
