Skip to content

Commit

Permalink
move ts checker to own forked process (which automatically uses paren…
Browse files Browse the repository at this point in the history
…t execPath)
  • Loading branch information
nicoecheza committed Feb 26, 2025
1 parent 25ddb89 commit 37bedfb
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions packages/@dcl/sdk-commands/src/logic/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,15 +218,15 @@ function runTypeChecker(components: BundleComponents, options: CompileOptions) {
const typeCheckerFuture = future<number>()

function runTsc() {
const args = [
require.resolve('typescript/lib/tsc'),
'-p',
'tsconfig.json',
options.emitDeclaration ? '--emitDeclarationOnly' : '--noEmit'
]
const tsBin = require.resolve('typescript/lib/tsc')
const args = ['-p', 'tsconfig.json', options.emitDeclaration ? '--emitDeclarationOnly' : '--noEmit']

printProgressStep(components.logger, `Running type checker`, 2, MAX_STEP)
const ts = child_process.spawn(process.execPath, args, { env: process.env, cwd: options.workingDirectory })
const ts = child_process.fork(tsBin, args, {
stdio: 'pipe',
env: process.env,
cwd: options.workingDirectory
})

return new Promise<number>((resolve, reject) => {
ts.on('close', (code) => {
Expand All @@ -238,8 +238,8 @@ function runTypeChecker(components: BundleComponents, options: CompileOptions) {
}
})

ts.stdout.pipe(process.stdout)
ts.stderr.pipe(process.stderr)
ts.stdout?.pipe(process.stdout)
ts.stderr?.pipe(process.stderr)
})
}

Expand Down

0 comments on commit 37bedfb

Please sign in to comment.