@hrc/babel-config
v1.2.2
Published
Create a Babel config for component packages of hrc to reduce bundle size
Downloads
22
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-importinstead.
Installation
npm install -D @hrc/babel-config babel-plugin-importUsage
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 };