You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Copy file name to clipboardExpand all lines: docs/01-app/05-api-reference/05-config/01-next-config-js/turbopack.mdx
+23-43
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,18 @@
1
1
---
2
-
title: turbo
2
+
title: turbopack
3
3
description: Configure Next.js with Turbopack-specific options
4
-
version: experimental
5
4
---
6
5
7
6
{/* 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. */}
8
7
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.
10
9
11
10
```ts filename="next.config.ts" switcher
12
11
importtype { NextConfig } from'next'
13
12
14
13
const nextConfig:NextConfig= {
15
-
experimental: {
16
-
turbo: {
17
-
// ...
18
-
},
14
+
turbopack: {
15
+
// ...
19
16
},
20
17
}
21
18
@@ -25,10 +22,8 @@ export default nextConfig
25
22
```js filename="next.config.js" switcher
26
23
/**@type{import('next').NextConfig}*/
27
24
constnextConfig= {
28
-
experimental: {
29
-
turbo: {
30
-
// ...
31
-
},
25
+
turbopack: {
26
+
// ...
32
27
},
33
28
}
34
29
@@ -82,13 +77,11 @@ Here is an example below using the [`@svgr/webpack`](https://www.npmjs.com/packa
82
77
83
78
```js filename="next.config.js"
84
79
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',
92
85
},
93
86
},
94
87
},
@@ -105,12 +98,10 @@ To configure resolve aliases, map imported patterns to their new destination in
105
98
106
99
```js filename="next.config.js"
107
100
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' },
114
105
},
115
106
},
116
107
}
@@ -128,18 +119,8 @@ To configure resolve extensions, use the `resolveExtensions` field in `next.conf
0 commit comments