diff --git a/packages/vite-plugin-checker/src/checkers/typescript/main.ts b/packages/vite-plugin-checker/src/checkers/typescript/main.ts index e4843e4d..7b521931 100644 --- a/packages/vite-plugin-checker/src/checkers/typescript/main.ts +++ b/packages/vite-plugin-checker/src/checkers/typescript/main.ts @@ -152,7 +152,13 @@ export class TscChecker extends Checker<'typescript'> { // Custom config path if (tsconfigPath) { const fullConfigPath = root ? path.join(root, tsconfigPath) : tsconfigPath - args = args.concat(['-p', fullConfigPath]) + + // In build mode, the tsconfig path is an argument to -b, e.g. "tsc -b [path]" + if (buildMode) { + args = args.concat([fullConfigPath]) + } else { + args = args.concat(['-p', fullConfigPath]) + } } return ['tsc', args]