From 866286c95eb3e0cca4074225bf83ffd2ff20bcd1 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Sun, 11 Mar 2018 14:57:10 -0400 Subject: [PATCH] minify HTML on export --- src/cli/export.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cli/export.ts b/src/cli/export.ts index 91a5c80..de3c348 100644 --- a/src/cli/export.ts +++ b/src/cli/export.ts @@ -5,6 +5,7 @@ import cheerio from 'cheerio'; import URL from 'url-parse'; import fetch from 'node-fetch'; import * as ports from 'port-authority'; +import { minify_html } from './utils/minify_html'; import { locations } from '../config'; export async function exporter(export_dir: string) { @@ -47,7 +48,7 @@ export async function exporter(export_dir: string) { if (message.type === 'text/html') { const file = `${export_dir}/${url.pathname}/index.html`; - sander.writeFileSync(file, message.body); + sander.writeFileSync(file, minify_html(message.body)); } else { const file = `${export_dir}/${url.pathname}`; sander.writeFileSync(file, message.body);