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/03-building-your-application/06-optimizing/14-local-development.mdx
+1-1
Original file line number
Diff line number
Diff line change
@@ -114,7 +114,7 @@ Tailwind CSS version 3.4.8 or newer will warn you about settings that might slow
114
114
115
115
If you've added custom webpack settings, they might be slowing down compilation.
116
116
117
-
Consider if you really need them for local development. You can optionally only include certain tools for production builds, or explore moving to Turbopack and using [loaders](/docs/app/api-reference/config/next-config-js/turbo#supported-loaders).
117
+
Consider if you really need them for local development. You can optionally only include certain tools for production builds, or explore moving to Turbopack and using [loaders](/docs/app/api-reference/config/next-config-js/turbopack#supported-loaders).
Copy file name to clipboardExpand all lines: docs/01-app/03-building-your-application/11-upgrading/06-from-create-react-app.mdx
+1-1
Original file line number
Diff line number
Diff line change
@@ -557,7 +557,7 @@ Next.js automatically sets up TypeScript if you have a `tsconfig.json`. Make sur
557
557
558
558
## Bundler Compatibility
559
559
560
-
Both Create React App and Next.js default to webpack for bundling. Next.js also offers [Turbopack](/docs/app/api-reference/config/next-config-js/turbo) for faster local development with:
560
+
Both Create React App and Next.js default to webpack for bundling. Next.js also offers [Turbopack](/docs/app/api-reference/config/next-config-js/turbopack) for faster local development with:
Copy file name to clipboardExpand all lines: docs/01-app/05-api-reference/05-config/01-next-config-js/turbopack.mdx
+33-42
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
@@ -51,8 +46,6 @@ The following options are available for the `turbo` configuration:
51
46
|`resolveAlias`| Map aliased imports to modules to load in their place. |
52
47
|`resolveExtensions`| List of extensions to resolve when importing files. |
53
48
|`moduleIds`| Assign module IDs |
54
-
|`treeShaking`| Enable tree shaking for the turbopack dev server and build. |
55
-
|`memoryLimit`| A target memory limit for turbo, in bytes. |
56
49
57
50
### Supported loaders
58
51
@@ -66,6 +59,17 @@ The following loaders have been tested to work with Turbopack's webpack loader i
|**JavaScript & TypeScript**|**Supported**| Uses SWC under the hood. Type-checking is not done by Turbopack (run `tsc --watch` or rely on your IDE for type checks). |
|**CommonJS**|**Supported**|`require()` syntax is handled out of the box. |
46
-
|**ESM**|**Supported**| Static and dynamic `import` are fully supported. |
47
-
|**Babel**| Partially Unsupported | Turbopack does not include Babel by default. However, you can [configure `babel-loader` via the Turbopack config](/docs/app/api-reference/config/next-config-js/turbo#configuring-webpack-loaders). |
|**JavaScript & TypeScript**|**Supported**| Uses SWC under the hood. Type-checking is not done by Turbopack (run `tsc --watch` or rely on your IDE for type checks). |
|**CommonJS**|**Supported**|`require()` syntax is handled out of the box. |
46
+
|**ESM**|**Supported**| Static and dynamic `import` are fully supported. |
47
+
|**Babel**| Partially Unsupported | Turbopack does not include Babel by default. However, you can [configure `babel-loader` via the Turbopack config](/docs/app/api-reference/config/next-config-js/turbopack#configuring-webpack-loaders). |
48
48
49
49
### Framework and React features
50
50
@@ -77,12 +77,12 @@ Turbopack in Next.js has **zero-configuration** for the common use cases. Below
|**Manual Aliases**|**Supported**|[Configure `resolveAlias` in `next.config.js`](/docs/app/api-reference/config/next-config-js/turbo#resolving-aliases) (similar to `webpack.resolve.alias`). |
84
-
|**Custom Extensions**|**Supported**|[Configure `resolveExtensions` in `next.config.js`](/docs/app/api-reference/config/next-config-js/turbo#resolving-custom-extensions). |
|**Manual Aliases**|**Supported**|[Configure `resolveAlias` in `next.config.js`](/docs/app/api-reference/config/next-config-js/turbopack#resolving-aliases) (similar to `webpack.resolve.alias`). |
84
+
|**Custom Extensions**|**Supported**|[Configure `resolveExtensions` in `next.config.js`](/docs/app/api-reference/config/next-config-js/turbopack#resolving-custom-extensions). |
@@ -102,7 +102,7 @@ Some features are not yet implemented or not planned:
102
102
- The `@value` rule (superseded by CSS variables).
103
103
-`:import` and `:export` ICSS rules.
104
104
-**`webpack()` configuration** in `next.config.js`
105
-
Turbopack replaces webpack, so `webpack()` configs are not recognized. Use the [`experimental.turbo` config](/docs/app/api-reference/config/next-config-js/turbo) instead.
105
+
Turbopack replaces webpack, so `webpack()` configs are not recognized. Use the [`experimental.turbo` config](/docs/app/api-reference/config/next-config-js/turbopack) instead.
106
106
-**AMP**
107
107
Not planned for Turbopack support in Next.js.
108
108
-**Yarn PnP**
@@ -118,14 +118,14 @@ Some features are not yet implemented or not planned:
118
118
-`experimental.fallbackNodePolyfills`
119
119
We plan to implement these in the future.
120
120
121
-
For a full, detailed breakdown of each feature flag and its status, see the [Turbopack API Reference](/docs/app/api-reference/config/next-config-js/turbo).
121
+
For a full, detailed breakdown of each feature flag and its status, see the [Turbopack API Reference](/docs/app/api-reference/config/next-config-js/turbopack).
122
122
123
123
## Configuration
124
124
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:
126
126
127
127
-**`rules`**
128
-
Define additional [webpack loaders](/docs/app/api-reference/config/next-config-js/turbo#configuring-webpack-loaders) for file transformations.
128
+
Define additional [webpack loaders](/docs/app/api-reference/config/next-config-js/turbopack#configuring-webpack-loaders) for file transformations.
129
129
-**`resolveAlias`**
130
130
Create manual aliases (like `resolve.alias` in webpack).
131
131
-**`resolveExtensions`**
@@ -139,19 +139,17 @@ Turbopack can be configured via `next.config.js` (or `next.config.ts`) under the
139
139
140
140
```js filename="next.config.js"
141
141
module.exports= {
142
-
experimental: {
143
-
turbo: {
144
-
// Example: adding an alias and custom file extension
{/* DO NOT EDIT. The content of this doc is generated from the source above. To edit the content of this page, navigate to the source page in your editor. 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. */}
0 commit comments