astro-critters-slim
Version:
🦔 Minimal Critters integration for astro.js
52 lines (37 loc) • 1.33 kB
Markdown
This **[Astro integration][astro-integration]** brings [critters][critters] to
your Astro projects SSG builds.
Critters inlines all of the css, a page is using, into the page. Note that it does that for **ALL** of the used css on the page, not just the critical / above-the-fold CSS.
```sh
npx astro add astro-critters-slim
```
The integration does not come with any options itsefl. For configuration head over to the [critters dogs][critters-docs].
To use the defaults as per critters
```ts
import crittersSlim from "astro-critters-slim";
export default {
integrations: [
// You want critters to run as late as possible
crittersSlim()
],
};
```
Some noteworthy options
```ts
import crittersSlim from "astro-critters-slim";
export default {
integrations: [
crittersSlim({
path: './path/to/your/dist', // path to your astro-build if somewhere special (default: './dist')
pruneSource: true, // 🚨 Not supported and kind a broken in critters anyway (default: false)
})
],
};
```
[]: https://github.com/GoogleChromeLabs/critters
[]: https://github.com/GoogleChromeLabs/critters#usage
[]: https://docs.astro.build/en/guides/integrations-guide/
See [CHANGELOG.md](CHANGELOG.md)