JSPM

gatsby-plugin-preact

7.0.0-alpha-v5.d20221012t101120.57+9c60f1ed1d
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3983
  • Score
    100M100P100Q127557F
  • License MIT

A Gatsby plugin which replaces React with Preact

Package Exports

  • gatsby-plugin-preact
  • gatsby-plugin-preact/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gatsby-plugin-preact) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

gatsby-plugin-preact

Provides drop-in support for replacing React with Preact.

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

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