PurgeCSS

Use PurgeCSS to remove unused CSS code.

Options

extensions string[]

The list of extensions this plugin applies to.

Default:
[ ".css" ]
contentExtensions string[]

The list of page extensions loaded as content.

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

Options for purgecss

Default:
{ extractors: [] }

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;