Skip to content

Commit

Permalink
docs(babelrc): precise usage without configuring plugins (vercel#16779)
Browse files Browse the repository at this point in the history
  • Loading branch information
vvo authored and Piotr Bosak committed Sep 26, 2020
1 parent 7d8203a commit 24b3b6e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion docs/advanced-features/customizing-babel-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,16 @@ Here's an example `.babelrc` file:

You can [take a look at this file](https://github.com/vercel/next.js/blob/canary/packages/next/build/babel/preset.ts) to learn about the presets included by `next/babel`.

To configure these presets/plugins, **do not** add them to `presets` or `plugins` in your custom `.babelrc`. Instead, configure them on the `next/babel` preset, like so:
To add presets/plugins **without configuring them**, you can do it this way:

```json
{
"presets": ["next/babel"],
"plugins": ["@babel/plugin-proposal-do-expressions"]
}
```

To add presets/plugins **with custom configuration**, do it on the `next/babel` preset like so:

```json
{
Expand Down

0 comments on commit 24b3b6e

Please sign in to comment.