brotli for astro static sites
Go to file
2024-04-15 23:12:46 +02:00
.vscode v1.0.0 2024-04-13 18:08:26 +02:00
src fix: log brotli 2024-04-13 22:55:00 +02:00
.gitignore v1.0.0 2024-04-13 18:08:26 +02:00
.npmignore v1.0.0 2024-04-13 18:08:26 +02:00
.prettierrc v1.0.0 2024-04-13 18:08:26 +02:00
LICENSE v1.0.0 2024-04-13 18:08:26 +02:00
package-lock.json v1.0.1 2024-04-15 23:12:46 +02:00
package.json v1.0.1 2024-04-15 23:12:46 +02:00
README.md v1.0.0 2024-04-13 18:08:26 +02:00
tsconfig.json v1.0.0 2024-04-13 18:08:26 +02:00

@zokki/astro-brotli

This integration finds files matching the specified extensions within the Astro build output directory and compresses them using brotli.

Note

astro-brotli only for statically generated build and pre-rendered routes.

Installation

  1. Install with npm.

    npm install @zokki/astro-brotli
    
  2. Import into the astro-config. The integration should be the last one in the array.

    import { brotli } from '@zokki/astro-brotli';
    
    export default defineConfig({
    	integrations: [brotli()],
    });
    

Configuration

/**
 * Toggle logging of all compressed files
 *
 * @default true
 */
logAllFiles?: boolean;
/**
 * Which extension should be compressed
 *
 * @default ['css', 'js', 'html', 'xml', 'cjs', 'mjs', 'svg', 'txt']
 */
extensions?: string[];
/**
 * Options for brotli compression
 */
brotliOptions?: BrotliOptions;

License

MIT © Tim-Niclas Oelschläger