mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-12 03:05:12 +00:00
minify HTML on export
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user