HTML Minifier Builder (@now/html-minifier)

Status: Stable

This builder optimizes .html files using html-minifier.

When you want your HTML source files to be minified so they are as small as possible (without any semantic changes) in production.

We'll define a index.html file:

<!DOCTYPE html>
<h1>Hello there This is intentionally long</h1>

Then we'll define our build step to optimize our images:

  "version": 2,
  "builds": [{ "src": "*.html", "use": "@now/html-minifier" }]

When we deploy with now and curl the resulting deployment URL, we will notice the HTML has been compressed:

<!doctype html><h1>Hello there This is intentionally long</h1>

The entrypoint is always a .html file you want to optimize.