From 1667b8b61cadd9e503cd5f9c862584b67116d8ca Mon Sep 17 00:00:00 2001 From: Maia Teegarden Date: Wed, 23 Oct 2024 13:56:10 -0700 Subject: [PATCH 1/3] Fix configuration examples for Turbopack --- .../05-next-config-js/turbo.mdx | 48 ++++++++++++------- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/docs/02-app/02-api-reference/05-next-config-js/turbo.mdx b/docs/02-app/02-api-reference/05-next-config-js/turbo.mdx index 00defc03a24c5..a394a70ce98db 100644 --- a/docs/02-app/02-api-reference/05-next-config-js/turbo.mdx +++ b/docs/02-app/02-api-reference/05-next-config-js/turbo.mdx @@ -11,8 +11,10 @@ The `turbo` option lets you customize [Turbopack](/docs/architecture/turbopack) import type { NextConfig } from 'next' const nextConfig: NextConfig = { - turbo: { - // ... + experimental: { + turbo: { + // ... + }, }, } @@ -22,8 +24,10 @@ export default nextConfig ```js filename="next.config.js" switcher /** @type {import('next').NextConfig} */ const nextConfig = { - turbo: { - // ... + experimental: { + turbo: { + // ... + }, }, } @@ -76,11 +80,13 @@ To configure loaders, add the names of the loaders you've installed and any opti ```js filename="next.config.js" module.exports = { - turbo: { - rules: { - '*.svg': { - loaders: ['@svgr/webpack'], - as: '*.js', + experimental: { + turbo: { + rules: { + '*.svg': { + loaders: ['@svgr/webpack'], + as: '*.js', + }, }, }, }, @@ -97,10 +103,12 @@ To configure resolve aliases, map imported patterns to their new destination in ```js filename="next.config.js" module.exports = { - turbo: { - resolveAlias: { - underscore: 'lodash', - mocha: { browser: 'mocha/browser-entry.js' }, + experimental: { + turbo: { + resolveAlias: { + underscore: 'lodash', + mocha: { browser: 'mocha/browser-entry.js' }, + }, }, }, } @@ -118,9 +126,11 @@ To configure resolve extensions, use the `resolveExtensions` field in `next.conf ```js filename="next.config.js" module.exports = { - turbo: { - resolveExtensions: ['.mdx', '.tsx', '.ts', '.jsx', '.js', '.mjs', '.json'], - }, + experimental: { + turbo: { + resolveExtensions: ['.mdx', '.tsx', '.ts', '.jsx', '.js', '.mjs', '.json'], + }, + }, } ``` @@ -141,8 +151,10 @@ To configure the module IDs strategy, use the `moduleIdStrategy` field in `next. ```js filename="next.config.js" module.exports = { - turbo: { - moduleIdStrategy: 'deterministic', + experimental: { + turbo: { + moduleIdStrategy: 'deterministic', + }, }, } ``` From e3911f2038f7596ec11e64a662111202930cc6db Mon Sep 17 00:00:00 2001 From: Maia Teegarden Date: Wed, 23 Oct 2024 13:59:22 -0700 Subject: [PATCH 2/3] Correct version history --- docs/02-app/02-api-reference/05-next-config-js/turbo.mdx | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/02-app/02-api-reference/05-next-config-js/turbo.mdx b/docs/02-app/02-api-reference/05-next-config-js/turbo.mdx index a394a70ce98db..6a31b708296b6 100644 --- a/docs/02-app/02-api-reference/05-next-config-js/turbo.mdx +++ b/docs/02-app/02-api-reference/05-next-config-js/turbo.mdx @@ -163,5 +163,4 @@ module.exports = { | Version | Changes | | ----------- | ------------------------------------------------- | -| `15.0.0-RC` | `turbo` is now stable and no longer experimental. | | `13.0.0` | `experimental.turbo` introduced. | From 07afd583ef542324943a1cbe9303b2bbfe3739ab Mon Sep 17 00:00:00 2001 From: Maia Teegarden Date: Wed, 23 Oct 2024 14:13:38 -0700 Subject: [PATCH 3/3] Run prettier --- .../05-next-config-js/turbo.mdx | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/docs/02-app/02-api-reference/05-next-config-js/turbo.mdx b/docs/02-app/02-api-reference/05-next-config-js/turbo.mdx index 6a31b708296b6..0d1cfce6f76bb 100644 --- a/docs/02-app/02-api-reference/05-next-config-js/turbo.mdx +++ b/docs/02-app/02-api-reference/05-next-config-js/turbo.mdx @@ -126,11 +126,19 @@ To configure resolve extensions, use the `resolveExtensions` field in `next.conf ```js filename="next.config.js" module.exports = { - experimental: { - turbo: { - resolveExtensions: ['.mdx', '.tsx', '.ts', '.jsx', '.js', '.mjs', '.json'], - }, + experimental: { + turbo: { + resolveExtensions: [ + '.mdx', + '.tsx', + '.ts', + '.jsx', + '.js', + '.mjs', + '.json', + ], }, + }, } ``` @@ -161,6 +169,6 @@ module.exports = { ## Version History -| Version | Changes | -| ----------- | ------------------------------------------------- | -| `13.0.0` | `experimental.turbo` introduced. | +| Version | Changes | +| -------- | -------------------------------- | +| `13.0.0` | `experimental.turbo` introduced. |