# gatsby-plugin-preact

> A Gatsby plugin which replaces React with Preact

Latest version **7.16.0** (published 2026-01-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install gatsby-plugin-preact
pnpm add gatsby-plugin-preact
yarn add gatsby-plugin-preact
bun add gatsby-plugin-preact
```

## Health

**Score 60/100 (C)** — status: stable.

Positive: no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 7.16.0 |
| Published | 2026-01-26 |
| First published | 2017-01-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=18.0.0 <26 |
| Dependencies | 4 |
| Unpacked size | 50.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 55914 |
| Author | Kyle Mathews |
| Maintainers | pieh, kathmbeck, serhalp-netlify, mlgualtieri-gatsby, fk, tylerbarnes, daniellewgatsby |
| Keywords | gatsby, gatsby-plugin, preact |

## Links

- npm: https://www.npmjs.com/package/gatsby-plugin-preact
- Repository: https://github.com/gatsbyjs/gatsby
- Homepage: https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-preact#readme
- Issues: https://github.com/gatsbyjs/gatsby/issues
- npm.io page: https://npm.io/package/gatsby-plugin-preact

## Dependencies (4)

- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.20.13
- [@prefresh/webpack](https://npm.io/package/@prefresh/webpack.md) ^3.3.4
- [@prefresh/babel-plugin](https://npm.io/package/@prefresh/babel-plugin.md) ^0.4.3
- [@gatsbyjs/webpack-hot-middleware](https://npm.io/package/@gatsbyjs/webpack-hot-middleware.md) ^2.25.3

## Recent versions

- 7.16.0 (latest) — 2026-01-26
- 7.17.0-next.0 (next) — 2025-11-27
- 7.17.0-react19.1 (react19) — 2025-11-26
- 5.15.0 (latest-v3) — 2022-12-07
- 6.25.0 (latest-v4) — 2022-12-07
- 7.0.0-alpha-drupal-proxyurl.14 (drupal-proxyurl) — 2022-11-22
- 6.14.0-alpha-transformer-json.26 (alpha-transformer-json) — 2022-10-12
- 7.0.0-alpha-v5.d20221012t101120.57 (alpha-v5) — 2022-10-12
- 6.23.0-alpha-a5-peer.70 (alpha-a5-peer) — 2022-09-14
- 6.23.0-alpha-preview-gh-api.26 (preview-gh-api) — 2022-09-08
- 6.23.0-alpha-9689ff.25 (alpha-9689ff) — 2022-08-31
- 6.18.0-alpha-drupal-self-reference.18 (drupal-self-reference) — 2022-07-19
- 6.15.0-alpha-wp-image-cdn-auth.48 (wp-image-cdn-auth) — 2022-05-20
- 6.8.0-alpha-image-service.24 (image-service) — 2022-02-10
- 6.6.0-alpha-ts-jit.60 (alpha-ts-jit) — 2022-01-21
- … 512 more at https://npm.io/package/gatsby-plugin-preact/versions

## README

# gatsby-plugin-preact

Provides drop-in support for replacing React with [Preact](https://preactjs.com/).

While Preact doesn't provide full support for the React ecosystem, it is an
intriguing option for Gatsby sites as it saves ~30kb of JavaScript vs. using
React.

> **Note:** This plugin uses Preact X, any version prior to `v10.0.0` is incompatible with Gatsby v2.

## Install

`npm install gatsby-plugin-preact preact preact-render-to-string`

## How to use

```javascript
// In your gatsby-config.js
plugins: [`gatsby-plugin-preact`]
```

---
_Source: https://npm.io/package/gatsby-plugin-preact · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
