-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(nextjs): Use not: foreign condition in turbopack loaders
#19502
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,6 +67,27 @@ export function supportsProductionCompileHook(version: string): boolean { | |
| return false; | ||
| } | ||
|
|
||
| /** | ||
| * Checks if the current Next.js version supports the `condition` field in Turbopack rules. | ||
| * This field was introduced in Next.js 16. | ||
| * | ||
| * @param version - version string to check. | ||
| * @returns true if Next.js version is 16 or higher | ||
| */ | ||
| export function supportsTurbopackRuleCondition(version: string): boolean { | ||
| if (!version) { | ||
| return false; | ||
| } | ||
|
|
||
| const { major } = parseSemver(version); | ||
|
|
||
| if (major === undefined) { | ||
| return false; | ||
| } | ||
|
|
||
| return major >= 16; | ||
| } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Condition gating may fail on canariesMedium Severity
Additional Locations (1)
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| /** | ||
| * Checks if the current Next.js version supports native debug ids for turbopack. | ||
| * This feature was first introduced in Next.js v15.6.0-canary.36 and marked stable in Next.js v16 | ||
|
|
||



Uh oh!
There was an error while loading. Please reload this page.