@hrc/babel-config
v1.2.1
Published
Create a Babel config for component packages of <hrc /> to reduce bundle size
Downloads
9
Maintainers
Readme
@hrc/babel-config
Create a Babel config for component packages of <hrc
/>
to reduce bundle size.
[!NOTE] If your project supports
Vite
, you can usevite-plugin-hrc-import
instead.
Installation
npm install -D @hrc/babel-config babel-plugin-import
Usage
In your .babelrc.js
file:
import hrcConfig from "@hrc/babel-config";
// single package
const plugins = [
...otherPlugins,
...hrcConfig("input")
];
// multiple packages
const plugins = [
...otherPlugins,
...hrcConfig(["button", "input"])
];
// all supported packages
const plugins = [
...otherPlugins,
...hrcConfig("all")
];
module.exports = { plugins };