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.
npm install -D @hrc/babel-config babel-plugin-import
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 };