JSPM

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

A Vite plugin that integrates PurgeCSS with Laravel template assets.

Package Exports

  • @erbelion/vite-plugin-laravel-purgecss
  • @erbelion/vite-plugin-laravel-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-laravel-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-laravel-purgecss

Get package from npm Downloads Downloads views

A Vite plugin that integrates PurgeCSS with Laravel 10/9 template assets.

Apart from Blade, it also supports frontend frameworks such as Svelte, Vue, React and Angular. It works well with Inertia.

Installation

yarn

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

npm

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

Usage

Use plugin in your Vite config (vite.config.ts)

import purge from '@erbelion/vite-plugin-laravel-purgecss'

export default {
    plugins: [
        purge({
            templates: ['blade']
        })
    ]
}

Options

Parameter Type Description
templates? string[] List of templates to be processed by PurgeCSS. See below.
paths? string[] List of paths to be processed by PurgeCSS.
safelist? UserDefinedSafelist Check available safelist options in PurgeCSS docs.

Templates

Parameter Path to be processed
blade resources/views/**/*.blade.php
svelte resources/{js,views}/**/*.svelte
vue resources/{js,views}/**/*.vue
react resources/{js,views}/**/*.{tsx,ts,jsx,js,html}
angular resources/{js,views}/**/*.html

You may also provide custom paths via paths option.

See also

vite-plugin-sveltekit-purgecss