This Astro integration minifies your static HTML output using html-minifier-terser on build time.
Install the integration using your preferred package manager.
npx astro add astro-minify-html
npm install -D astro-minify-html
// astro.config.
import { minifyHtml } from "astro-minify-html"
export default defineConfig({
integrations: [minifyHtml()],
})
Refer to the html-minifier-terser documentation for available options.
export default defineConfig({
integrations: [htmlMinifier({ removeComments: true })],
})