astro-crush
v1.0.0
Published
📦️ The high-performance asset minification engine for Astro. Crush CSS, HTML, and JS to achieve peak loading speeds.
Downloads
119
Maintainers
Readme
- node >= 22.17.0
- bun >= 1.1.0
bun i -D astro-crushnpm i -D astro-crushpnpm i -D astro-crushyarn i -D astro-crushTo use Astro Crush, simply add it to the astro config file:
import { defineConfig } from 'astro/config';
import astroCrush from 'astro-crush';
export default defineConfig({
integrations: [astroCrush()]
});This will automatically minify your HTML, CSS, and JS files during the build process. For more advanced usage and configuration options, please refer to the Configuration section below.
you can customize the behavior of Astro Crush by passing options to the plugin function. Here are some of the available options:
import { defineConfig } from 'astro/config';
import astroCrush from 'astro-crush';
export default defineConfig({
integrations: [astroCrush({
disableCss: false, // Disable CSS minification
disableHtml: false, // Disable HTML minification
disableJavascript: false, // Disable JS minification
cssOptions: {
// CSS minification options (using lightningcss)
},
htmlOptions: {
// HTML minification options (using html-minifier-terser)
},
jsOptions: {
// JS minification options (using terser)
}
})]
});