Turbopack (beta) is an incremental bundler optimized for JavaScript and TypeScript, written in Rust, and built into Next.js.
Turbopack can be used in Next.js in both the pages and app directories for faster local development. To enable Turbopack, use the --turbo flag when running the Next.js development server.
{
"scripts": {
"dev": "next dev --turbo",
"build": "next build",
"start": "next start",
"lint": "next lint"
}
}Turbopack in Next.js requires zero-configuration for most users and can be extended for more advanced use cases. To learn more about the currently supported features for Turbopack, view the API Reference.
Turbopack currently only supports next dev and does not support next build. We are currently working on support for builds as we move closer towards stability.
These features are currently not supported:
webpack() configuration in next.config.js .babelrc) .babelrc file, you might no longer need it because Next.js includes common Babel plugins as SWC transforms that can be enabled. You can read more about this in the compiler documentation.babel-loader.@next/font (legacy font support). @next/font is deprecated in favor of next/font. next/font is fully supported with Turbopack.new Worker('file', import.meta.url). experimental.nextScriptWorkers experimental.urlImports experimental.urlImports in Next.js with Turbopack.Trace files allow the Next.js team to investigate and improve performance metrics and memory usage. To generate a trace file, append NEXT_TURBOPACK_TRACING=1 to the next dev --turbo command, this will generate a .next/trace.log file.
When reporting issues related to Turbopack performance and memory usage, please include the trace file in your GitHub issue.
© 2024 Vercel, Inc.
Licensed under the MIT License.
https://nextjs.org/docs/architecture/turbopack