@zokki/astro-brotli
Version:
brotli compression for astro static sites
32 lines (29 loc) • 874 B
text/typescript
import { AstroIntegration } from 'astro';
import { BrotliOptions } from 'node:zlib';
type BrotliConfig = {
/**
* 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
*
* @default { params: { [constants.BROTLI_PARAM_QUALITY]: 11 } }
*/
brotliOptions?: BrotliOptions;
};
/**
* An Astro integration to compresses files with brotli.
*
* This integration finds files matching the specified extensions within the Astro build output directory and compresses them using brotli.
*/
declare const brotli: (config?: BrotliConfig) => AstroIntegration;
export { type BrotliConfig, brotli };