Skip to content

Instantly share code, notes, and snippets.

@macropygia
macropygia / minifier.mjs
Created September 6, 2023 03:23
HTML Minifier Integration for Astro using html-minifier-terser
import { join } from 'node:path';
import { fileURLToPath } from 'node:url';
import { readFile, writeFile } from 'node:fs/promises';
import { glob } from 'fast-glob';
import { minify } from 'html-minifier-terser';
const options = {
minifyCSS: true,
};