Skip to content

Commit

Permalink
only load runTypeCheck when used
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Apr 16, 2021
1 parent b342a51 commit 3a8532e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/next/lib/verifyTypeScriptSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
hasNecessaryDependencies,
NecessaryDependencies,
} from './typescript/hasNecessaryDependencies'
import { runTypeCheck, TypeCheckResult } from './typescript/runTypeCheck'
import type { TypeCheckResult } from './typescript/runTypeCheck'
import { TypeScriptCompileError } from './typescript/TypeScriptCompileError'
import { writeAppTypeDeclarations } from './typescript/writeAppTypeDeclarations'
import { writeConfigurationDefaults } from './typescript/writeConfigurationDefaults'
Expand Down Expand Up @@ -41,6 +41,8 @@ export async function verifyTypeScriptSetup(
await writeAppTypeDeclarations(dir)

if (typeCheckPreflight) {
const { runTypeCheck } = require('./typescript/runTypeCheck')

// Verify the project passes type-checking before we go to webpack phase:
return await runTypeCheck(ts, dir, tsConfigPath)
}
Expand Down

0 comments on commit 3a8532e

Please sign in to comment.