diff --git a/lib/index.js b/lib/index.js index f606859..3338675 100755 --- a/lib/index.js +++ b/lib/index.js @@ -41,11 +41,8 @@ const tmpTsconfig = { fs.writeFileSync(tmpTsconfigPath, JSON.stringify(tmpTsconfig, null, 2)) // Type-check our files -const { status } = spawnSync( - resolveFromModule( - 'typescript', - `../.bin/tsc${process.platform === 'win32' ? '.cmd' : ''}`, - ), +const { status, error } = spawnSync( + 'tsc', ['-p', tmpTsconfigPath, ...remainingArgsToForward], { stdio: 'inherit' }, ) @@ -53,4 +50,6 @@ const { status } = spawnSync( // Delete temp config file fs.unlinkSync(tmpTsconfigPath) +if (error) throw error + process.exit(status)