JSPM

@erbelion/vite-plugin-sveltekit-purgecss

0.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 40
  • Score
    100M100P100Q60509F
  • License MIT

A Vite plugin that integrates PurgeCSS with SvelteKit assets.

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

Experimental version Get package from npm Downloads Downloads views likes

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-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