Skip to content

TheElegantCoding/astro-class-shortener

Repository files navigation

Astro class name shortener

divider

  📦 SETUP⚙️ CONFIGURATION️️️🛰️ FEATURES

divider



                   

divider

About

An 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.

divider

Table of content


divider

Requirements

  • node >= 22.17.0
  • bun >= 1.1.0

divider

Installation

Bun

bun i -D astro-class-shortener

Npm

npm i -D astro-class-shortener

Pnpm

pnpm i -D astro-class-shortener

Yarn

yarn i -D astro-class-shortener

divider

Usage

In 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() ]
  });

divider

Configuration

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' ]
      }) 
    ]
  });

divider

  BACK TO TOP

divider

  Copyright © All rights reserved
  developed by LuisdaByte and

About

📦 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.

Topics

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors