Skip to content
This repository has been archived by the owner on Apr 8, 2023. It is now read-only.

mattjennings/satori-jsx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

satori-jsx

Use JSX with Satori without React

Install

npm install satori-jsx

Usage

Vite

import satori from 'satori-jsx/vite'

export default {
  plugins: [satori()]
}

If you're using typescript, make sure to add the following to your tsconfig.json:

{
  "compilerOptions": {
    "jsx": "preserve",
  }
}

Babel

npm install -D @babel/plugin-syntax-jsx @babel/plugin-transform-react-jsx

Update your .babelrc

{
  "plugins": [
    "@babel/plugin-syntax-jsx",
    [
      "@babel/plugin-transform-react-jsx",
      {
        "runtime": "automatic",
        "importSource": "satori-jsx"          
      }
    ]
  ]
}

Typescript

For JSX types, it's best to use react's.

npm install -D @types/react @types/react-dom

About

Use JSX with Satori without React

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published