Package Exports
- @frontendista/astro-html-minify
- @frontendista/astro-html-minify/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@frontendista/astro-html-minify) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Astro HTML minify
HTML minifier for statically rendered files in Astro.
1. Usage
1.1 Using astro add
command
# Using npm
npx astro add @frontendista/astro-html-minify
# Using yarn
yarn astro add @frontendista/astro-html-minify
# Using pnpm
pnpx astro add @frontendista/astro-html-minify
1.2 Manually
1.2.1 Install dependency
# Using npm
npm install --save-dev @frontendista/astro-html-minify
# Using npm
yarn add -D @frontendista/astro-html-minify
# Using npm
pnpm add -D @frontendista/astro-html-minify
1.2.2 Add to configuration
Default import the integration and add it to integrations
key in your astro.config.{mjs,js,ts}
configuration.
import { defineConfig } from "astro/config";
import minify from "@frontendista/astro-html-minify";
export default defineConfig({
integrations: [minify()]
});
1.3 Customize minifiers options
import { defineConfig } from "astro/config";
import minify from "@frontendista/astro-html-minify";
export default defineConfig({
integrations: [
minify({
html: {
// Customize Terser options
},
css: {
// Customize LightningCSS options
},
js: {
// Customize ESBuild options
}
})
]
});