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
docs: update core documentation for Turbopack as default bundler
Phase 1: Core Documentation Updates
- Update Turbopack docs to reflect it's now default for dev
- Add --webpack flag documentation to CLI reference
- Update Getting Started guide to show Turbopack as default
- Remove unnecessary --turbopack flags from examples
- Add guidance on when to use --webpack flag
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
Copy file name to clipboardExpand all lines: docs/01-app/01-getting-started/01-installation.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -101,7 +101,7 @@ Then, add the following scripts to your `package.json` file:
101
101
```json filename="package.json"
102
102
{
103
103
"scripts": {
104
-
"dev": "next dev --turbopack",
104
+
"dev": "next dev",
105
105
"build": "next build",
106
106
"start": "next start",
107
107
"lint": "eslint",
@@ -112,12 +112,12 @@ Then, add the following scripts to your `package.json` file:
112
112
113
113
These scripts refer to the different stages of developing an application:
114
114
115
-
-`next dev --turbopack`: Starts the development server using Turbopack.
115
+
-`next dev`: Starts the development server using Turbopack (default bundler).
116
116
-`next build`: Builds the application for production.
117
117
-`next start`: Starts the production server.
118
118
-`eslint`: Runs ESLint.
119
119
120
-
Turbopack is stable for `dev`. For production builds, Turbopack is in beta. To try it, run`next build --turbopack`. See the [Turbopack docs](/docs/app/api-reference/turbopack)for status and caveats.
120
+
Turbopack is now the default bundler, to use Webpack instead of Turbopack for development, use`next dev --webpack`. See the [Turbopack docs](/docs/app/api-reference/turbopack)information on configuration.
|`[directory]`| A directory in which to build the application. If not provided, current directory is used. |
49
-
|`--turbopack`| Starts development mode using [Turbopack](/docs/app/api-reference/turbopack). Also available as `--turbo`. |
49
+
|`--turbopack`| Force enable [Turbopack](/docs/app/api-reference/turbopack) (enabled by default). Also available as `--turbo`. |
50
+
|`--webpack`| Use Webpack instead of the default [Turbopack](/docs/app/api-reference/turbopack) bundler for development. |
50
51
|`-p` or `--port <port>`| Specify a port number on which to start the application. Default: 3000, env: PORT |
51
52
|`-H`or `--hostname <hostname>`| Specify a hostname on which to start the application. Useful for making the application available for other devices on the network. Default: 0.0.0.0 |
52
53
|`--experimental-https`| Starts the server with HTTPS and generates a self-signed certificate. |
@@ -74,7 +75,8 @@ The following options are available for the `next build` command:
|`[directory]`| A directory on which to build the application. If not provided, the current directory will be used. |
77
-
|`--turbopack`| Build using [Turbopack](/docs/app/api-reference/turbopack) (beta). Also available as `--turbo`. |
78
+
|`--turbopack`| Build using [Turbopack](/docs/app/api-reference/turbopack). Also available as `--turbo`. |
79
+
|`--webpack`| Build using Webpack. |
78
80
|`-d` or `--debug`| Enables a more verbose build output. With this flag enabled additional build output like rewrites, redirects, and headers will be shown. |
79
81
||
80
82
|`--profile`| Enables production [profiling for React](https://react.dev/reference/react/Profiler). |
Copy file name to clipboardExpand all lines: docs/01-app/03-api-reference/08-turbopack.mdx
+23-13Lines changed: 23 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,19 +18,31 @@ We built Turbopack to push the performance of Next.js, including:
18
18
19
19
## Getting started
20
20
21
-
To enable Turbopack in your Next.js project, add the `--turbopack` flag to the `dev` and `build` scripts in your `package.json` file:
21
+
Turbopack is now the **default bundler** in Next.js. No configuration is needed to use Turbopack:
22
22
23
23
```json filename="package.json" highlight={3}
24
24
{
25
25
"scripts": {
26
-
"dev": "next dev --turbopack",
27
-
"build": "next build --turbopack",
26
+
"dev": "next dev",
27
+
"build": "next build",
28
28
"start": "next start"
29
29
}
30
30
}
31
31
```
32
32
33
-
Currently, Turbopack for `dev` is stable, while `build` is in beta. We are actively working on production support as Turbopack moves closer to stability.
33
+
### Using Webpack instead
34
+
35
+
If you need to use Webpack for instead of Turbopack, you can opt-in with the `--webpack` flag:
36
+
37
+
```json filename="package.json"
38
+
{
39
+
"scripts": {
40
+
"dev": "next dev --webpack",
41
+
"build": "next build --webpack",
42
+
"start": "next start"
43
+
}
44
+
}
45
+
```
34
46
35
47
## Supported features
36
48
@@ -204,7 +216,7 @@ For more in-depth configuration examples, see the [Turbopack config documentatio
204
216
If you encounter performance or memory issues and want to help the Next.js team diagnose them, you can generate a trace file by appending `NEXT_TURBOPACK_TRACING=1` to your dev command:
205
217
206
218
```bash
207
-
NEXT_TURBOPACK_TRACING=1 next dev --turbopack
219
+
NEXT_TURBOPACK_TRACING=1 next dev
208
220
```
209
221
210
222
This will produce a `.next/trace-turbopack` file. Include that file when creating a GitHub issue on the [Next.js repo](https://github.com/vercel/next.js) to help us investigate.
@@ -213,13 +225,11 @@ This will produce a `.next/trace-turbopack` file. Include that file when creatin
213
225
214
226
Turbopack is a **Rust-based**, **incremental** bundler designed to make local development and builds fast—especially for large applications. It is integrated into Next.js, offering zero-config CSS, React, and TypeScript support.
215
227
216
-
Stay tuned for more updates as we continue to improve Turbopack and add production build support. In the meantime, give it a try with `next dev --turbopack` and let us know your feedback.
0 commit comments