Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docs for configuring Turbopack #71755

Merged
merged 3 commits into from
Oct 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 40 additions & 21 deletions docs/02-app/02-api-reference/05-next-config-js/turbo.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ The `turbo` option lets you customize [Turbopack](/docs/architecture/turbopack)
import type { NextConfig } from 'next'

const nextConfig: NextConfig = {
turbo: {
// ...
experimental: {
turbo: {
// ...
},
},
}

Expand All @@ -22,8 +24,10 @@ export default nextConfig
```js filename="next.config.js" switcher
/** @type {import('next').NextConfig} */
const nextConfig = {
turbo: {
// ...
experimental: {
turbo: {
// ...
},
},
}

Expand Down Expand Up @@ -76,11 +80,13 @@ To configure loaders, add the names of the loaders you've installed and any opti

```js filename="next.config.js"
module.exports = {
turbo: {
rules: {
'*.svg': {
loaders: ['@svgr/webpack'],
as: '*.js',
experimental: {
turbo: {
rules: {
'*.svg': {
loaders: ['@svgr/webpack'],
as: '*.js',
},
},
},
},
Expand All @@ -97,10 +103,12 @@ To configure resolve aliases, map imported patterns to their new destination in

```js filename="next.config.js"
module.exports = {
turbo: {
resolveAlias: {
underscore: 'lodash',
mocha: { browser: 'mocha/browser-entry.js' },
experimental: {
turbo: {
resolveAlias: {
underscore: 'lodash',
mocha: { browser: 'mocha/browser-entry.js' },
},
},
},
}
Expand All @@ -118,8 +126,18 @@ To configure resolve extensions, use the `resolveExtensions` field in `next.conf

```js filename="next.config.js"
module.exports = {
turbo: {
resolveExtensions: ['.mdx', '.tsx', '.ts', '.jsx', '.js', '.mjs', '.json'],
experimental: {
turbo: {
resolveExtensions: [
'.mdx',
'.tsx',
'.ts',
'.jsx',
'.js',
'.mjs',
'.json',
],
},
},
}
```
Expand All @@ -141,15 +159,16 @@ To configure the module IDs strategy, use the `moduleIdStrategy` field in `next.

```js filename="next.config.js"
module.exports = {
turbo: {
moduleIdStrategy: 'deterministic',
experimental: {
turbo: {
moduleIdStrategy: 'deterministic',
},
},
}
```

## Version History

| Version | Changes |
| ----------- | ------------------------------------------------- |
| `15.0.0-RC` | `turbo` is now stable and no longer experimental. |
| `13.0.0` | `experimental.turbo` introduced. |
| Version | Changes |
| -------- | -------------------------------- |
| `13.0.0` | `experimental.turbo` introduced. |
Loading