babel-plugin-import-helpers
v0.0.2
Published
Babel plugin to map babel helpers to module imports.
Downloads
174
Readme
babel-plugin-import-helpers
Babel plugin to map used babel helpers to module imports.
##How to install
npm i --save-dev babel-plugin-import-helpers
How to use
Add the plugin to the plugin section of your .babelrc
file or relevant babel setting location.
{
"presets": [ "es2015" ],
"plugins": [ "import-helpers" ]
}
Options
Specify the import module using the module
parameter, defaults to
babel-helpers-module
.
{
"plugins": [
["import-helpers", { "module": "my-helper-module" }]
]
}
You may specify individual mappings using the map
parameter. You can map to an export of the module specified
in the module
parameter using a string value, or provide a specific module if you specify an array value, with the
first value being the module, the second being the export.
{
"plugins": [
["import-helpers", {
"module": "my-helper-module",
"map": {
"toArray": "arrayify",
"createClass": ["class-util", "defineClass"]
}
}]
]
}
Helpers that used keywords or reserved words are prefixed with an underscore, typeof
, instanceof
and extends
are renamed to
_typeof
, _instanceof
and _extends
.