astro-class-shortener
v1.0.4
Published
📦 Astro integration to minify and mangle CSS class names across HTML, CSS, and JS files. Boost performance by reducing payload size and obfuscate your source code structure.
Downloads
166
Maintainers
Readme
- node >= 22.17.0
- bun >= 1.1.0
bun i -D astro-class-shortenernpm i -D astro-class-shortenerpnpm i -D astro-class-shorteneryarn i -D astro-class-shortenerIn your astro.config.ts file add the following code in integrations:
import { defineConfig } from 'astro/config';
import { classShortener } from 'astro-class-shortener';
export default defineConfig({
integrations: [ classShortener() ]
});Extra settings that can be added.
import { defineConfig } from 'astro/config';
import { classShortener } from 'astro-class-shortener';
export default defineConfig({
integrations: [
classShortener({
// Exclude some classes to be renamed and shorted
exclude: [ 'is-active' ]
})
]
});