gzip for astro static sites
https://zokki.net
.vscode | ||
src | ||
.gitignore | ||
.npmignore | ||
.prettierrc | ||
LICENSE | ||
package-lock.json | ||
package.json | ||
README.md | ||
tsconfig.json |
@zokki/astro-gzip
This integration finds files matching the specified extensions within the Astro build output directory and compresses them using GZip.
Note
astro-gzip
only for statically generated build and pre-rendered routes.
Installation
-
Install with npm.
npm install @zokki/astro-gzip
-
Import into the astro-config. The integration should be the last one in the array.
import { gzip } from '@zokki/astro-gzip'; export default defineConfig({ integrations: [gzip()], });
Configuration
/**
* Toggle logging of all gzipped files
*
* @default true
*/
logAllFiles?: boolean;
/**
* Which extension should be gzipped
*
* @default ['css', 'js', 'html', 'xml', 'cjs', 'mjs', 'svg', 'txt']
*/
extensions?: string[];
/**
* Options for the zipping
*
* @default { level: 9 }
*/
zlibOptions?: ZlibOptions;
License
MIT © Tim-Niclas Oelschläger