Skip to content

@hrc/babel-config

Create Babel config for component packages of <hrc /> to reduce bundle size.

Installation

Terminal window
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 };

Supported packages