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
Copy file name to clipboardExpand all lines: docs/01-app/03-api-reference/05-config/01-next-config-js/turbopack.mdx
+39-5Lines changed: 39 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,7 @@ The following options are available for the `turbopack` configuration:
50
50
|`rules`| List of supported webpack loaders to apply when running with Turbopack. |
51
51
|`resolveAlias`| Map aliased imports to modules to load in their place. |
52
52
|`resolveExtensions`| List of extensions to resolve when importing files. |
53
+
|`debugIds`| Enable generation of debug IDs in JavaScript bundles and source maps. |
53
54
54
55
### Supported loaders
55
56
@@ -252,12 +253,45 @@ module.exports = {
252
253
253
254
This overwrites the original resolve extensions with the provided list. Make sure to include the default extensions.
254
255
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
+
255
289
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).
0 commit comments