From aa72acb4fc7938246961f335a8d35e13aeba4b32 Mon Sep 17 00:00:00 2001 From: Vincent Voyer Date: Wed, 2 Sep 2020 12:05:32 +0200 Subject: [PATCH] docs(babelrc): precise usage without configuring plugins Before this commit, it was unclear if we could add plugins to the babelrc plugins entry directly. --- docs/advanced-features/customizing-babel-config.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/advanced-features/customizing-babel-config.md b/docs/advanced-features/customizing-babel-config.md index c111bc22097ca..17da327d19861 100644 --- a/docs/advanced-features/customizing-babel-config.md +++ b/docs/advanced-features/customizing-babel-config.md @@ -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 {