babel-preset-think-node
babel preset for ThinkJS 3.x
, with @babel/preset-env & @babel/plugin-transform-runtime
Install
npm install --save-dev babel-preset-think-node
Usage
.babelrc
{
"presets": ["think-node", {}]
}
CLI
babel script.js --presets think-node
Node API
require('babel-core').transform('code', {
presets: ['think-node', {}]
});
Options
set option for all plugin in object first level, or specific plugin by plugin name.
{
"presets": [
["think-node", {
}]
]
}
@babel/preset-env default options
const defaultPresetOptions = {
targets: { node: '8' },
modules: 'auto',
debug: false,
useBuiltIns: 'usage',
corejs: 2,
}