Turbopack: add rules.*.type config to allow changing the type of a module#88788
Merged
Turbopack: add rules.*.type config to allow changing the type of a module#88788
rules.*.type config to allow changing the type of a module#88788Conversation
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
rules.*.type config to allow changing the type of a module
Collaborator
Tests Passed |
Collaborator
Stats from current PR🟢 1 improvement
📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles: **435 kB** → **435 kB** ✓81 files with content-based hashes (individual files not comparable between builds) Server Middleware
Build DetailsBuild Manifests
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
|
CodSpeed Performance ReportMerging this PR will not alter performanceComparing Summary
Footnotes
|
mischnic
reviewed
Jan 20, 2026
docs/01-app/03-api-reference/05-config/01-next-config-js/turbopack.mdx
Outdated
Show resolved
Hide resolved
mischnic
reviewed
Jan 20, 2026
e004b63 to
1f1d161
Compare
aec38a1 to
8d516c5
Compare
test/e2e/app-dir/webpack-loader-module-type/webpack-loader-module-type.test.ts
Show resolved
Hide resolved
lukesandberg
approved these changes
Jan 27, 2026
8d516c5 to
7b8a524
Compare
7660664 to
8c8f749
Compare
7b8a524 to
9ae1c87
Compare
8c8f749 to
f35ef5b
Compare
9ae1c87 to
fee6cab
Compare
1f3b5cb to
abcd9a5
Compare
498c3f9 to
f8259a8
Compare
abcd9a5 to
1c8e8c6
Compare
Member
Author
f8259a8 to
383fdd6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What?
This PR adds support for the
typeoption in Turbopack rules, enabling users to set the module type directly without requiring a custom loader. This mirrors webpack'stypeoption (e.g.,type: 'asset/resource').Users can now configure how files are processed by setting the module type directly:
When using type: 'asset', importing the file returns its URL:
More types are available. See docs