@erbelion/vite-plugin-sveltekit-purgecss
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

vite-plugin-sveltekit-purgecss

Experimental version Get package from npm Downloads Downloads views

A Vite plugin that integrates PurgeCSS with SvelteKit css assets (currently updated to SvelteKit 1.0.0).

Warning: This package is in experimental state, updates may be critical.

Installation

yarn

yarn add -D @erbelion/vite-plugin-sveltekit-purgecss

npm

npm i -D @erbelion/vite-plugin-sveltekit-purgecss

Usage

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.

See also

vite-plugin-laravel-purgecss

Package Sidebar

Install

npm i @erbelion/vite-plugin-sveltekit-purgecss

Weekly Downloads

21

Version

0.1.0

License

MIT

Unpacked Size

14 kB

Total Files

10

Last publish

Collaborators

  • erbelion