Files
Tim NeutkensandGitHub fe19e10c39 Turbopack: Don't resolve tsconfig relative to file (#83484)
## What?

Changes in #83331 accidentally changed behavior of how `tsconfig.json`
is resolved. When using Next.js we don't want it to be resolved relative
to the current file being compiled. It should only use the application
root.

This PR fixes the behavior to match what it was before and adds a test
that fails if it breaks again.
2025-09-05 15:49:44 +02:00

16 lines
491 B
TypeScript

import { nextTestSetup } from 'e2e-utils'
describe('tsconfig-no-relative-resolve', () => {
const { next } = nextTestSetup({
files: __dirname,
skipStart: true,
})
// Next.js should only use the application root tsconfig.json file and not files relative to the file being compiled.
it('should fail to build', async () => {
const { exitCode, cliOutput } = await next.build()
expect(exitCode).toBe(0)
expect(cliOutput).not.toContain('non-existent-package')
})
})