babel-plugin-transform-carbon-imports
v9.1.2
Published
> Babel plugin for transforming import paths for `carbon-components-react`
Downloads
27
Readme
babel-plugin-transform-carbon-imports
Babel plugin for transforming import paths for
carbon-components-react
Usage
Run the following command using npm:
npm i babel-plugin-transform-carbon-imports --save-dev
If you prefer Yarn, use the following command instead:
yarn add babel-plugin-transform-carbon-imports --dev
Then, in your babel config you add the following:
{
"plugins": ["transform-carbon-imports"]
}
Options
babel-plugin-transform-carbon-imports
supports a couple of options, namely:
throwOnNamespace
: toggle whether you want the plugin to throw when it encountersimport * from 'carbon-components-react'
syntax.
You can pass in these options when adding the plugin to your babel configuration, for example:
{
"plugins": [["transform-carbon-imports", { "throwOnNamespace": false }]]
}