amis-rpc-design/node_modules/babel-preset-fbjs/README.md

51 lines
629 B
Markdown
Raw Normal View History

2023-10-07 19:42:30 +08:00
# babel-preset-fbjs
> Babel preset for Facebook projects.
## Install
```sh
$ npm install --save-dev babel-preset-fbjs
```
## Basic Usage
### Via `.babelrc`
**.babelrc**
```json
{
"presets": ["fbjs"]
}
```
### Via CLI
```sh
$ babel script.js --presets fbjs
```
### Via Node API
```javascript
require('@babel/core').transform('code', {
presets: ['fbjs']
});
```
## Advanced Usage
```javascript
require('@babel/core').transform('code', {
presets: [
require('babel-preset-fbjs/configure')({
autoImport: true,
inlineRequires: false,
rewriteModules: {},
stripDEV: false
}
]
});
```