PurgeCSS

Use PurgeCSS to remove unused CSS code.

Options

contentExtensions string[]

The list of page extensions loaded as content.

Default:
[ ".html", ".js" ]
options object

Options for purgecss

content object

css object

defaultExtractor function

extractors object

fontFace boolean

keyframes boolean

output string

rejected boolean

rejectedCss boolean

sourceMap boolean any

stdin boolean

stdout boolean

variables boolean

safelist object object

blocklist object

skippedContentGlobs object

dynamicAttributes string[]

Description

This plugin allows using PurgeCSS utility to remove unused CSS code, making your CSS files smaller to improve the site performance.

Installation

Import this plugin in your _config.ts file to use it:

import lume from "lume/mod.ts";
import purgecss from "lume/plugins/purgecss.ts";

const site = lume();
site.use(purgecss());

export default site;