babel-preset-think-lebab
v1.0.0
Published
lebab plugin preset for thinkjs in node6+
Downloads
1
Readme
babel-preset-think-lebab
lebab plugin preset for ThinkJS 3.x
Included plugins
- ES2015
- modules (transform-es2015-modules-commonjs)
- ES2016
- exponentiation operator (transform-exponentiation-operator)
- ES2017
- trailing function commas (syntax-trailing-function-commas)
- async / await (transform-async-to-generator)
- babel-transform-runtime
- babel-plugin-transform-object-rest-spread
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", {
"loose": true,
"transform-es2015-modules-commonjs": {
"allowTopLevelThis": true
},
"transform-runtime": {
"helpers": false,
"polyfill": false,
"regenerator": true,
"moduleName": "babel-runtime"
},
"transform-object-rest-spread": {
"useBuiltIns": true
},
"object-rest-spread": false //set false if you want close this transform plugin
}]
]
}