Skip to content

Commit 338ecf3

Browse files
authored
Update installation.md
1 parent b798064 commit 338ecf3

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

docs/getting-started/installation.md

+8-7
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,17 @@ yarn add react-async
1515
> This package requires `react` as a peer dependency. Please make sure to install that as well. If you want to use the
1616
> `useAsync` hook, you'll need `[email protected]` or later.
1717
18-
## Targeting older browsers
18+
## Transpiling for legacy browsers
1919

20-
If you are targeting older browsers you need to transpile `react-async` with babel.
20+
This project targets the latest ECMAScript version. Our packages on npm do not contain ES5 code for legacy browsers. If you need to target a browser which does not support the latest version of ECMAScript, you'll have to handle transpilation yourself. Usually this will automatically be handled by the framework you use (CRA, Next.js, Gatsby), but sometimes you may need to tweak your Webpack settings to transpile `react-async` with Babel.
2121

22-
To transpile `node_modules` with babel you need to use a `babel.config.js`, for more information see [babel's documentation](https://babeljs.io/docs/en/configuration#whats-your-use-case).
22+
To transpile `node_modules` with Babel you need to use a `babel.config.js`, for more information see [Babel's documentation](https://babeljs.io/docs/en/configuration#whats-your-use-case).
2323

2424
In your `webpack.config.js` make sure that the rule for `babel-loader`:
25-
* doesn't exclude `node_modules` from matching via the `exclude` pattern;
26-
* excludes `core-js` as it shouldn't be transpiled;
27-
* is passed the `configFile` option pointing to the `babel.config.js` file.
25+
26+
- doesn't exclude `node_modules` from matching via the `exclude` pattern;
27+
- excludes `core-js` as it shouldn't be transpiled;
28+
- is passed the `configFile` option pointing to the `babel.config.js` file.
2829

2930
```
3031
{
@@ -34,7 +35,7 @@ In your `webpack.config.js` make sure that the rule for `babel-loader`:
3435
loader: 'babel-loader',
3536
options: {
3637
configFile: './babel.config.js',
37-
// This is recommended to enable when transpiling node_modules to improve build times for consecutive builds.
38+
// Caching is recommended when transpiling node_modules to speed up consecutive builds
3839
cacheDirectory: true,
3940
}
4041
}]

0 commit comments

Comments
 (0)