Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thinkjs/babel-preset-think-node
Babel plugin preset for ThinkJS 3.x
https://github.com/thinkjs/babel-preset-think-node
babel nodejs presets thinkjs
Last synced: about 12 hours ago
JSON representation
Babel plugin preset for ThinkJS 3.x
- Host: GitHub
- URL: https://github.com/thinkjs/babel-preset-think-node
- Owner: thinkjs
- License: mit
- Created: 2017-02-14T13:01:14.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-09T03:29:14.000Z (over 5 years ago)
- Last Synced: 2024-09-20T00:42:00.033Z (about 2 months ago)
- Topics: babel, nodejs, presets, thinkjs
- Language: JavaScript
- Homepage:
- Size: 12.7 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# babel-preset-think-node
[![npm](https://img.shields.io/npm/v/babel-preset-think-node.svg)](https://www.npmjs.com/package/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`
```js
{
"presets": ["think-node", {/* @babel/preset-env options */}]
}
```
### CLI```
babel script.js --presets think-node
```### Node API
```js
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.
```js
{
"presets": [
["think-node", {
// @babel/preset-env options
}]
]
}
```#### @babel/preset-env default options
```js
const defaultPresetOptions = {
targets: { node: '8' },
modules: 'auto',
debug: false,
useBuiltIns: 'usage',
corejs: 2,
}
```