update readme [skip ci]
This commit is contained in:
parent
2c97212fd4
commit
ba5aa48b0c
@ -1,4 +1,4 @@
|
||||
# [WIP Do Not Use] babel-preset-env
|
||||
# [WIP 0.0.0] babel-preset-env
|
||||
|
||||
> Babel preset for all envs.
|
||||
|
||||
@ -8,41 +8,21 @@
|
||||
$ npm install --save-dev babel-preset-env
|
||||
```
|
||||
|
||||
## Usage
|
||||
## Usage via `.babelrc`
|
||||
|
||||
### Via `.babelrc` (Recommended)
|
||||
|
||||
**.babelrc**
|
||||
|
||||
```json
|
||||
{
|
||||
"presets": ["env"]
|
||||
}
|
||||
```
|
||||
|
||||
### Via CLI
|
||||
|
||||
```sh
|
||||
$ babel script.js --presets env
|
||||
```
|
||||
|
||||
### Via Node API
|
||||
|
||||
```javascript
|
||||
require("babel-core").transform("code", {
|
||||
presets: ["env"]
|
||||
});
|
||||
```
|
||||
|
||||
## Options
|
||||
### Options
|
||||
|
||||
* `loose` - Enable "loose" transformations for any plugins in this preset that allow them (Disabled by default).
|
||||
* `modules` - Enable transformation of ES6 module syntax to another module type (Enabled by default to `"commonjs"`).
|
||||
* Can be `false` to not transform modules, or one of `["amd", "umd", "systemjs", "commonjs"]`
|
||||
|
||||
```
|
||||
{
|
||||
presets: [
|
||||
"presets": [
|
||||
["env", {
|
||||
chrome: 49
|
||||
"chrome": 49,
|
||||
"loose": true,
|
||||
"modules": false
|
||||
}]
|
||||
]
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user