HTML Minifier Builder (@now/html-minifier)

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:

▲  curl https://optipng-deployment-f0hz0ny2d.now.sh/
<!doctype html><h1>Hello there This is intentionally long</h1>

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