1.0.1 • Published 7 years ago
babel-plugin-transform-node-module v1.0.1
babel-plugin-transform-node-module
This plugin transforms ES2015 modules to Node.js module system.
#Installation
npm install --save-dev babel-plugin-transform-node-moduleUsage
Via .babelrc (Recommended)
.babelrc
{
"plugins": ["transform-node-module"]
}Options
kind- A string value, specifying the type of variable used to import is "const", "let" or "var"..
{
"plugins": [
["transform-node-module", { "kind": "const" }]
]
}module- A boolean value, that if true will usemodule.exportsinstead ofexports.
{
"plugins": [
["transform-node-module", { "module": true }]
]
}Via CLI
babel --plugins transform-node-module script.js