babel-plugin-kirei
Babel plugin for Kirei to instrument Kirei components to add Hot Module Replacement
Installation
npm i -D babel-plugin-kirei
or if you use yarn
yarn add -D babel-plugin-kirei
API
import babelPlugin from 'babel-plugin-kirei';
Creates the Babel plugin from a set of optional plugin options.
Returns: Babel Plugin
Parameters:
opts {KireiPluginOptions}
- Object of optional options to pass to the plugin
include {string|string[]}
- Optional string or array of strings of glob patterns to includeexclude {string|string[]}
- Optional string or array of strings of glob patterns to excludeextension {string|string[]}
- Optional string or array of strings of extensions to include (dot prefixed like .js or .ts)
Examples
To use this plugin define it using vite.config.js
const kirei = require('babel-plugin-kirei');
module.exports = {
open: true,
port: 3000,
plugins: [
kirei({
include: 'src/*',
exclude: [/node_modules/, 'test/'],
extension: [ '.js', '.ts' ],
}),
],
};
Testing (TODO: not yet finished)
npm run test
License
MIT