Skip to content

Commit d53bbbc

Browse files
committed
Turbopack: update docs for config.turbopack
As `turbo.mdx` is renamed to `turbopack.mdx`, we’ll need a redirect on the nextjs.org website to take users to the new location. This will be a separate PR in its repository.
1 parent b6d99d6 commit d53bbbc

File tree

2 files changed

+29
-51
lines changed

2 files changed

+29
-51
lines changed

Diff for: docs/01-app/05-api-reference/05-config/01-next-config-js/turbo.mdx renamed to docs/01-app/05-api-reference/05-config/01-next-config-js/turbopack.mdx

+23-43
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
11
---
2-
title: turbo
2+
title: turbopack
33
description: Configure Next.js with Turbopack-specific options
4-
version: experimental
54
---
65

76
{/* The content of this doc is shared between the app and pages router. You can use the `<PagesOnly>Content</PagesOnly>` component to add content that is specific to the Pages Router. Any shared content should not be wrapped in a component. */}
87

9-
The `turbo` option lets you customize [Turbopack](/docs/app/api-reference/turbopack) to transform different files and change how modules are resolved.
8+
The `turbopack` option lets you customize [Turbopack](/docs/app/api-reference/turbopack) to transform different files and change how modules are resolved.
109

1110
```ts filename="next.config.ts" switcher
1211
import type { NextConfig } from 'next'
1312

1413
const nextConfig: NextConfig = {
15-
experimental: {
16-
turbo: {
17-
// ...
18-
},
14+
turbopack: {
15+
// ...
1916
},
2017
}
2118

@@ -25,10 +22,8 @@ export default nextConfig
2522
```js filename="next.config.js" switcher
2623
/** @type {import('next').NextConfig} */
2724
const nextConfig = {
28-
experimental: {
29-
turbo: {
30-
// ...
31-
},
25+
turbopack: {
26+
// ...
3227
},
3328
}
3429

@@ -82,13 +77,11 @@ Here is an example below using the [`@svgr/webpack`](https://www.npmjs.com/packa
8277

8378
```js filename="next.config.js"
8479
module.exports = {
85-
experimental: {
86-
turbo: {
87-
rules: {
88-
'*.svg': {
89-
loaders: ['@svgr/webpack'],
90-
as: '*.js',
91-
},
80+
turbopack: {
81+
rules: {
82+
'*.svg': {
83+
loaders: ['@svgr/webpack'],
84+
as: '*.js',
9285
},
9386
},
9487
},
@@ -105,12 +98,10 @@ To configure resolve aliases, map imported patterns to their new destination in
10598

10699
```js filename="next.config.js"
107100
module.exports = {
108-
experimental: {
109-
turbo: {
110-
resolveAlias: {
111-
underscore: 'lodash',
112-
mocha: { browser: 'mocha/browser-entry.js' },
113-
},
101+
turbopack: {
102+
resolveAlias: {
103+
underscore: 'lodash',
104+
mocha: { browser: 'mocha/browser-entry.js' },
114105
},
115106
},
116107
}
@@ -128,18 +119,8 @@ To configure resolve extensions, use the `resolveExtensions` field in `next.conf
128119

129120
```js filename="next.config.js"
130121
module.exports = {
131-
experimental: {
132-
turbo: {
133-
resolveExtensions: [
134-
'.mdx',
135-
'.tsx',
136-
'.ts',
137-
'.jsx',
138-
'.js',
139-
'.mjs',
140-
'.json',
141-
],
142-
},
122+
turbopack: {
123+
resolveExtensions: ['.mdx', '.tsx', '.ts', '.jsx', '.js', '.mjs', '.json'],
143124
},
144125
}
145126
```
@@ -161,16 +142,15 @@ To configure the module IDs strategy, use the `moduleIdStrategy` field in `next.
161142

162143
```js filename="next.config.js"
163144
module.exports = {
164-
experimental: {
165-
turbo: {
166-
moduleIdStrategy: 'deterministic',
167-
},
145+
turbopack: {
146+
moduleIdStrategy: 'deterministic',
168147
},
169148
}
170149
```
171150

172151
## Version History
173152

174-
| Version | Changes |
175-
| -------- | -------------------------------- |
176-
| `13.0.0` | `experimental.turbo` introduced. |
153+
| Version | Changes |
154+
| -------- | ----------------------------------------------- |
155+
| `15.3.0` | `experimental.turbo` is changed to `turbopack`. |
156+
| `13.0.0` | `experimental.turbo` introduced. |

Diff for: docs/01-app/05-api-reference/08-turbopack.mdx

+6-8
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ For a full, detailed breakdown of each feature flag and its status, see the [Tur
122122

123123
## Configuration
124124

125-
Turbopack can be configured via `next.config.js` (or `next.config.ts`) under the `experimental.turbo` key. Configuration options include:
125+
Turbopack can be configured via `next.config.js` (or `next.config.ts`) under the `turbopack` key. Configuration options include:
126126

127127
- **`rules`**
128128
Define additional [webpack loaders](/docs/app/api-reference/config/next-config-js/turbo#configuring-webpack-loaders) for file transformations.
@@ -139,14 +139,12 @@ Turbopack can be configured via `next.config.js` (or `next.config.ts`) under the
139139

140140
```js filename="next.config.js"
141141
module.exports = {
142-
experimental: {
143-
turbo: {
144-
// Example: adding an alias and custom file extension
145-
resolveAlias: {
146-
underscore: 'lodash',
147-
},
148-
resolveExtensions: ['.mdx', '.tsx', '.ts', '.jsx', '.js', '.json'],
142+
turbopack: {
143+
// Example: adding an alias and custom file extension
144+
resolveAlias: {
145+
underscore: 'lodash',
149146
},
147+
resolveExtensions: ['.mdx', '.tsx', '.ts', '.jsx', '.js', '.json'],
150148
},
151149
}
152150
```

0 commit comments

Comments
 (0)