Package Exports
- @erbelion/vite-plugin-sveltekit-purgecss
- @erbelion/vite-plugin-sveltekit-purgecss/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@erbelion/vite-plugin-sveltekit-purgecss) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
vite-plugin-sveltekit-purgecss
A Vite plugin that integrates PurgeCSS with SvelteKit assets.
Warning: This package is in experimental state, updates may be critical.
Installation
yarn
yarn add -D @erbelion/vite-plugin-sveltekit-purgecssnpm
npm i -D @erbelion/vite-plugin-sveltekit-purgecssUsage
Use plugin in your Vite config (vite.config.ts).
import { purge } from '@erbelion/vite-plugin-sveltekit-purgecss'
const config: UserConfig = {
plugins: [
sveltekit(),
purge()
]
}PurgeCSS will work in .svelte files if css assets are imported using @import inside style tag or import inside script tag.
Default path that will always be processed: src/**/*.{svelte,html}.
Default safelist item that will always be processed: /(svelte-)[a-zA-Z0-9]{6}/.
Additional Options
| Parameter | Type | Description |
|---|---|---|
| paths? | string[] |
List of paths to be processed by PurgeCSS. |
| safelist? | UserDefinedSafelist |
Check available safelist options in PurgeCSS docs. |