brotli for astro static sites
.vscode | ||
src | ||
.gitignore | ||
.npmignore | ||
.prettierrc | ||
LICENSE | ||
package-lock.json | ||
package.json | ||
README.md | ||
tsconfig.json |
@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
-
Install with npm.
npm install @zokki/astro-brotli
-
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