Unverified Commit 71c5ab62 authored by Vincent Voyer's avatar Vincent Voyer Committed by GitHub

docs(babelrc): precise usage without configuring plugins (#16779)

parent 260814cc
...@@ -26,7 +26,16 @@ Here's an example `.babelrc` file: ...@@ -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`. 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 ```json
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment