Skip to content

Commit

Permalink
feat: Update documentation on configuring Babel, removing the section…
Browse files Browse the repository at this point in the history
… on passing '{"modules": false}' as that is no longer needed since Babel 7. Closes #3717
  • Loading branch information
Robin-Hoodie committed Oct 10, 2020
1 parent f4f8196 commit f046307
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions docs/07-tools.md
Expand Up @@ -166,14 +166,12 @@ Before Babel will actually compile your code, it needs to be configured. Create
```json
{
"presets": [
["@babel/env", {"modules": false}]
"@babel/env"
]
}
```

There are a few unusual elements to this setup. First, we're setting "modules": false, otherwise Babel will convert our modules to CommonJS before Rollup gets a chance to do its thing, causing it to fail.

Secondly, we're putting our `.babelrc.json` file in `src`, rather than the project root. This allows us to have a different `.babelrc.json` for things like tests, if we need that later – See the [Babel documentation](https://babeljs.io/docs/en/config-files#project-wide-configuration) for more information on both project wide and file relative configuration.
We're putting our `.babelrc.json` file in `src`, rather than the project root. This allows us to have a different `.babelrc.json` for things like tests, if we need that later – See the [Babel documentation](https://babeljs.io/docs/en/config-files#project-wide-configuration) for more information on both project wide and file relative configuration.

Now, before we run rollup, we need to install
[`babel-core`](https://babeljs.io/docs/en/babel-core)
Expand Down

0 comments on commit f046307

Please sign in to comment.