Skip to content

Commit 86a4de8

Browse files
committed
docs for debug ids feature
1 parent 00912fd commit 86a4de8

File tree

1 file changed

+39
-5
lines changed
  • docs/01-app/03-api-reference/05-config/01-next-config-js

1 file changed

+39
-5
lines changed

docs/01-app/03-api-reference/05-config/01-next-config-js/turbopack.mdx

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ The following options are available for the `turbopack` configuration:
5050
| `rules` | List of supported webpack loaders to apply when running with Turbopack. |
5151
| `resolveAlias` | Map aliased imports to modules to load in their place. |
5252
| `resolveExtensions` | List of extensions to resolve when importing files. |
53+
| `debugIds` | Enable generation of debug IDs in JavaScript bundles and source maps. |
5354

5455
### Supported loaders
5556

@@ -252,12 +253,45 @@ module.exports = {
252253

253254
This overwrites the original resolve extensions with the provided list. Make sure to include the default extensions.
254255

256+
### Debug IDs
257+
258+
Debug IDs provide stable identifiers for JavaScript bundles and source maps that help with debugging and error tracking. When enabled, Turbopack adds debug ID comments to generated JavaScript files and includes debug ID properties in source maps, following the [TC39 Debug ID proposal](https://github.com/tc39/ecma426/blob/main/proposals/debug-id.md).
259+
260+
To enable debug IDs, set `debugIds` to `true`:
261+
262+
```js filename="next.config.js"
263+
module.exports = {
264+
turbopack: {
265+
debugIds: true,
266+
},
267+
}
268+
```
269+
270+
When enabled, your generated JavaScript files will include debug ID comments:
271+
272+
```js
273+
// Your bundled code here...
274+
275+
//# debugId=12345678-1234-1234-1234-123456789abc
276+
//# sourceMappingURL=your-bundle.js.map
277+
```
278+
279+
And your source maps will include the debug ID property:
280+
281+
```json
282+
{
283+
"version": 3,
284+
"sources": ["..."],
285+
"debugId": "12345678-1234-1234-1234-123456789abc"
286+
}
287+
```
288+
255289
For more information and guidance for how to migrate your app to Turbopack from webpack, see [Turbopack's documentation on webpack compatibility](https://turbo.build/pack/docs/migrating-from-webpack).
256290

257291
## Version History
258292

259-
| Version | Changes |
260-
| -------- | ----------------------------------------------- |
261-
| `16.0.0` | `turbopack.rules.*.condition` was added. |
262-
| `15.3.0` | `experimental.turbo` is changed to `turbopack`. |
263-
| `13.0.0` | `experimental.turbo` introduced. |
293+
| Version | Changes |
294+
| -------- | ----------------------------------------------------------------------- |
295+
| `16.0.0` | `turbopack.rules.*.condition`and `turbopack.enableDebugIds` were added. |
296+
| `15.3.0` | `experimental.turbo` is changed to `turbopack`. |
297+
| `13.0.0` | `experimental.turbo` introduced. |

0 commit comments

Comments
 (0)