Babel plugin to map babel helpers to module imports.
npm install babel-plugin-import-helpersBabel plugin to map used babel helpers to module imports.
##How to install
``bash`
npm i --save-dev babel-plugin-import-helpers
file or relevant babel setting location.`js
{
"presets": [ "es2015" ],
"plugins": [ "import-helpers" ]
}
`Options
Specify the import module using the module parameter, defaults to
babel-helpers-module.
`json
{
"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.
`json
{
"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`.