babel-preset-think-node
v2.0.0
Published
babel preset for ThinkJS
Downloads
162
Readme
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", {/* @babel/preset-env options */}]
}
CLI
babel script.js --presets think-node
Node API
require('babel-core').transform('code', {
presets: ['think-node', {/* @babel/preset-env options */}]
});
Options
set option for all plugin in object first level, or specific plugin by plugin name.
{
"presets": [
["think-node", {
// @babel/preset-env options
}]
]
}
@babel/preset-env default options
const defaultPresetOptions = {
targets: { node: '8' },
modules: 'auto',
debug: false,
useBuiltIns: 'usage',
corejs: 2,
}