Skip to content

Commit a10288f

Browse files
Kent C. Doddsthymikee
Kent C. Dodds
authored andcommitted
docs: replace preset-es2015 with preset-env (#5385)
1 parent 79086ee commit a10288f

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,12 @@ _Note: Explicitly installing `regenerator-runtime` is not needed if you use
116116
Don't forget to add a [`.babelrc`](https://babeljs.io/docs/usage/babelrc/) file
117117
in your project's root folder. For example, if you are using ES6 and
118118
[React.js](https://facebook.github.io/react/) with the
119-
[`babel-preset-es2015`](https://babeljs.io/docs/plugins/preset-es2015/) and
119+
[`babel-preset-env`](https://babeljs.io/docs/plugins/preset-env/) and
120120
[`babel-preset-react`](https://babeljs.io/docs/plugins/preset-react/) presets:
121121
122122
```json
123123
{
124-
"presets": ["es2015", "react"]
124+
"presets": ["env", "react"]
125125
}
126126
```
127127
@@ -132,16 +132,16 @@ You are now set up to use all ES6 features and React specific syntax.
132132
> `test`. It will not use `development` section like Babel does by default when
133133
> no `NODE_ENV` is set.
134134
135-
> Note: If you've turned off transpilation of ES2015 modules with the option
135+
> Note: If you've turned off transpilation of ES modules with the option
136136
> `{ "modules": false }`, you have to make sure to turn this on in your test
137137
> environment.
138138
139139
```json
140140
{
141-
"presets": [["es2015", {"modules": false}], "react"],
141+
"presets": [["env", {"modules": false}], "react"],
142142
"env": {
143143
"test": {
144-
"presets": [["es2015"], "react"]
144+
"presets": [["env"], "react"]
145145
}
146146
}
147147
}

docs/TutorialReact.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Also see [using babel](GettingStarted.md#using-babel).
2727
Run
2828

2929
```bash
30-
npm install --save-dev jest babel-jest babel-preset-es2015 babel-preset-react react-test-renderer
30+
npm install --save-dev jest babel-jest babel-preset-env babel-preset-react react-test-renderer
3131
```
3232

3333
Your `package.json` should look something like this (where `<current-version>`
@@ -42,7 +42,7 @@ jest configuration entries:
4242
},
4343
"devDependencies": {
4444
"babel-jest": "<current-version>",
45-
"babel-preset-es2015": "<current-version>",
45+
"babel-preset-env": "<current-version>",
4646
"babel-preset-react": "<current-version>",
4747
"jest": "<current-version>",
4848
"react-test-renderer": "<current-version>"
@@ -55,7 +55,7 @@ jest configuration entries:
5555
```json
5656
// .babelrc
5757
{
58-
"presets": ["es2015", "react"]
58+
"presets": ["env", "react"]
5959
}
6060
```
6161

0 commit comments

Comments
 (0)