Package Exports
- astro-min
Readme
astro-min
Extremely Fast and Smart Minification of ð HTML ðĄ JS ðĩ CSS ðĢ SVG Meticulously optimized for Speed ðĨ and Effectiveness ð
Feature Highlights âĻ
- ð fastest processing ~1000 files/s
- ðŠķ lighter build output ~25% smaller
- ðĶ small packaged size ~30KB
Feature Roadmap ðą
HTML, CSS, JS, SVG
Files and inline Code
Static Site Minification
Support SSR / Hybrid Rendering
Getting started ðŊ
Use your package manager of your choice
# NPM
npm run astro add astro-min
# Bun
bun astro add astro-min
# PNPM
pnpm astro add astro-min
# Yarn
yarn astro add astro-min
Manual Installation ð§âðŧ
Install package
astro-min
Import and add to integrations list
//astro.config.mjs
import { defineConfig } from 'astro/config'
import minify from 'astro-min'
export default defineConfig({
integrations: [minify()]
})
Options ð§
//astro.config.mjs
import { defineConfig } from 'astro/config'
import minify from 'astro-min'
export default defineConfig({
integrations: [
minify(
do_not_minify_doctype: false,
ensure_spec_compliant_unquoted_attribute_values: false,
keep_closing_tags: false,
keep_comments: false,
keep_html_and_head_opening_tags: false,
keep_input_type_text_attr: false,
keep_spaces_between_attributes: false,
keep_ssi_comments: false,
minify_css: false,
minify_js: false,
preserve_brace_template_syntax: false,
preserve_chevron_percent_template_syntax: false,
remove_bangs: false,
remove_processing_instructions: false,
)
]
})