@@ -212,8 +212,8 @@ export async function bundleSingleProject(components: BundleComponents, options:
212
212
}
213
213
214
214
function runTypeChecker ( components : BundleComponents , options : CompileOptions ) {
215
+ const tsBin = require . resolve ( 'typescript/lib/tsc' )
215
216
const args = [
216
- require . resolve ( 'typescript/lib/tsc' ) ,
217
217
'-p' ,
218
218
'tsconfig.json' ,
219
219
'--preserveWatchOutput' ,
@@ -224,7 +224,11 @@ function runTypeChecker(components: BundleComponents, options: CompileOptions) {
224
224
if ( options . watch ) args . push ( '--watch' )
225
225
226
226
printProgressStep ( components . logger , `Running type checker` , 2 , MAX_STEP )
227
- const ts = child_process . spawn ( process . execPath , args , { env : process . env , cwd : options . workingDirectory } )
227
+ const ts = child_process . fork ( tsBin , args , {
228
+ stdio : 'pipe' ,
229
+ env : process . env ,
230
+ cwd : options . workingDirectory
231
+ } )
228
232
const typeCheckerFuture = future < number > ( )
229
233
230
234
ts . on ( 'close' , ( code ) => {
@@ -239,8 +243,8 @@ function runTypeChecker(components: BundleComponents, options: CompileOptions) {
239
243
typeCheckerFuture . resolve ( code )
240
244
} )
241
245
242
- ts . stdout . pipe ( process . stdout )
243
- ts . stderr . pipe ( process . stderr )
246
+ ts . stdout ? .pipe ( process . stdout )
247
+ ts . stderr ? .pipe ( process . stderr )
244
248
245
249
/* istanbul ignore if */
246
250
if ( options . watch ) {
0 commit comments