Minify HTML

Minify the HTML code of your pages.

Description

The MinifyHTML plugin minifies the HTML code of your pages using the minify-html minifier. It can also minify CSS and JavaScript code.

Installation

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

import lume from "@lumeland/lume";
import minifyHTML from "@lumeland/plugin-minify-html";

const site = lume();

site.use(minifyHTML(/* Options */));

export default site;

Configuration

This plugin accepts a configuration object. The available options are:

  • extensions: An array with the extensions of the files that will be minified. By default it is [".html"].
  • options: An object with the available options for minify-html.

If you need to minify CSS and / or JS files, it's recommended that you use plugins specifically for those instead, like LightningCSS and Terser respectively.