Status: Deprecated
Warning: This Builder is deprecated. Please use the @now/static-build Builder instead which supports the same features, improved performance, and more.

This builder optimizes .html files using html-minifier.

When to Use It

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

How to Use It

We'll define a index.html file:

<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8" />
    <h3>This is very long</h3>

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, the resulting deployment URL will be live as

Next, use curl to query the deployment URL, you will notice the HTML has been compressed:

<!doctype html><html lang=en><meta charset=UTF-8><title>Document</title><h3>This is very long</h3>

The example deployment above is open-source and you can view the code for it here:

Technical Details


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