Skip to content

Commit

Permalink
Remove turbopack next dir check for ignored path
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Nov 27, 2024
1 parent 9a1e75d commit d5e0694
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,12 @@ import type { StackFrame } from 'next/dist/compiled/stacktrace-parser'
import type { Project, TurbopackStackFrame } from '../../../../build/swc/types'
import { getSourceMapFromFile } from '../internal/helpers/get-source-map-from-file'
import { findSourceMap } from 'node:module'
import { NEXT_PROJECT_ROOT } from '../../../../build/next-dir-paths'

const nextRelativePath = NEXT_PROJECT_ROOT.replace(process.cwd() + '/', '')

function shouldIgnorePath(modulePath: string): boolean {
return (
modulePath.includes('node_modules') ||
// Only relevant for when Next.js is symlinked e.g. in the Next.js monorepo
modulePath.includes('next/dist') ||
// TODO: turbopack recovers the original source path of the next package
(!!process.env.TURBOPACK && modulePath.startsWith(nextRelativePath))
modulePath.includes('next/dist')
)
}

Expand Down

0 comments on commit d5e0694

Please sign in to comment.