Skip to content

Commit 1c80166

Browse files
lukesandbergclaude
andcommitted
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]>
1 parent 409f919 commit 1c80166

File tree

3 files changed

+30
-18
lines changed

3 files changed

+30
-18
lines changed

docs/01-app/01-getting-started/01-installation.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Then, add the following scripts to your `package.json` file:
101101
```json filename="package.json"
102102
{
103103
"scripts": {
104-
"dev": "next dev --turbopack",
104+
"dev": "next dev",
105105
"build": "next build",
106106
"start": "next start",
107107
"lint": "eslint",
@@ -112,12 +112,12 @@ Then, add the following scripts to your `package.json` file:
112112

113113
These scripts refer to the different stages of developing an application:
114114

115-
- `next dev --turbopack`: Starts the development server using Turbopack.
115+
- `next dev`: Starts the development server using Turbopack (default bundler).
116116
- `next build`: Builds the application for production.
117117
- `next start`: Starts the production server.
118118
- `eslint`: Runs ESLint.
119119

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.
121121

122122
<AppOnly>
123123

docs/01-app/03-api-reference/06-cli/next.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ The following commands are available:
4646
| ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
4747
| `-h, --help` | Show all available options. |
4848
| `[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. |
5051
| `-p` or `--port <port>` | Specify a port number on which to start the application. Default: 3000, env: PORT |
5152
| `-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 |
5253
| `--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:
7475
| ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
7576
| `-h, --help` | Show all available options. |
7677
| `[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. |
7880
| `-d` or `--debug` | Enables a more verbose build output. With this flag enabled additional build output like rewrites, redirects, and headers will be shown. |
7981
| |
8082
| `--profile` | Enables production [profiling for React](https://react.dev/reference/react/Profiler). |

docs/01-app/03-api-reference/08-turbopack.mdx

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,31 @@ We built Turbopack to push the performance of Next.js, including:
1818

1919
## Getting started
2020

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:
2222

2323
```json filename="package.json" highlight={3}
2424
{
2525
"scripts": {
26-
"dev": "next dev --turbopack",
27-
"build": "next build --turbopack",
26+
"dev": "next dev",
27+
"build": "next build",
2828
"start": "next start"
2929
}
3030
}
3131
```
3232

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+
```
3446

3547
## Supported features
3648

@@ -204,7 +216,7 @@ For more in-depth configuration examples, see the [Turbopack config documentatio
204216
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:
205217

206218
```bash
207-
NEXT_TURBOPACK_TRACING=1 next dev --turbopack
219+
NEXT_TURBOPACK_TRACING=1 next dev
208220
```
209221

210222
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
213225

214226
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.
215227

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.
217-
218228
## Version Changes
219229

220-
| Version | Changes |
221-
| --------- | -------------------------------------------------------------- |
222-
| `v16.0.0` | Automatic support for Babel when a configuration file is found |
223-
| `v15.5.0` | Turbopack support for `build` beta |
224-
| `v15.3.0` | Experimental support for `build` |
225-
| `v15.0.0` | Turbopack for `dev` stable |
230+
| Version | Changes |
231+
| --------- | ----------------------------------------------------------------------------------------------------------------- |
232+
| `v16.0.0` | Turbopack becomes the default bundler for Next.js. Automatic support for Babel when a configuration file is found |
233+
| `v15.5.0` | Turbopack support for `build` beta |
234+
| `v15.3.0` | Experimental support for `build` |
235+
| `v15.0.0` | Turbopack for `dev` stable |

0 commit comments

Comments
 (0)