Skip to content

Latest commit

 

History

History

plugin-babel

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

babel-plugin-saykit

Babel plugin for SayKit.

Coverage

Use this for Next.js (.babelrc), React Native, Expo, Metro, or any Babel-driven pipeline. For Vite, Rollup, Webpack, esbuild, and similar bundlers, use unplugin-saykit instead.

Install

pnpm add -D babel-plugin-saykit

Usage

{
  "plugins": ["saykit"]
}
export default {
  plugins: ['saykit'],
};

The plugin rewrites macros. For Next.js and Metro, wrap the config with withSayKit, which compiles catalogues to ordinary .js modules before anything is bundled and recompiles them in dev:

import { withSayKit } from 'babel-plugin-saykit/next';
export default withSayKit({});
const { withSayKit } = require('babel-plugin-saykit/metro');
module.exports = withSayKit(getDefaultConfig(__dirname));

With plain Babel, run saykit compile before building.

Documentation

See saykit.js.org/integrations/babel.