Back to Gatsby

Make your Gatsby site faster with Preact.

deprecated-packages/gatsby-recipes/recipes/preact.mdx

2.20.0639 B
Original Source

Make your Gatsby site faster with Preact.

Preact is a small alternative to React with the same API.

Preact will reduce the bundle size by ~30kb on the network and ~24kb during parse/compile time.

This recipe:


Installs the necessary NPM packages.

<NPMPackage name="gatsby-plugin-preact" /> <NPMPackage name="preact" /> <NPMPackage name="preact-render-to-string" />

Adds the Preact plugin to your Gatsby config. It will setup the correct configuration, which will let gatsby use Preact instead of React.

<GatsbyPlugin name="gatsby-plugin-preact" />


Once you install this recipe, your site will be faster than ever!