Skip to content

Commit

Permalink
fix: include root in tsconfig path if specified
Browse files Browse the repository at this point in the history
  • Loading branch information
zsparal committed Jul 18, 2021
1 parent 485f832 commit 5ec177a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/vite-plugin-checker/src/checkers/typescript/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os from 'os'
import path from 'path'
import invariant from 'tiny-invariant'
import ts from 'typescript'
import { parentPort } from 'worker_threads'
Expand Down Expand Up @@ -123,7 +124,10 @@ export class TscChecker extends Checker<'typescript'> {
build: {
buildBin: (config) => {
if (typeof config.typescript === 'object' && config.typescript.tsconfigPath) {
return ['tsc', ['--noEmit', '-p', config.typescript.tsconfigPath]]
const tsconfig = config.typescript.root
? path.join(config.typescript.root, config.typescript.tsconfigPath)
: config.typescript.tsconfigPath
return ['tsc', ['--noEmit', '-p', tsconfig]]
}
return ['tsc', ['--noEmit']]
},
Expand Down

0 comments on commit 5ec177a

Please sign in to comment.