From 2bda3a371688e3576cdfa318841f5a908beebdf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E6=98=8E=E5=81=A5?= <1187356256@qq.com> Date: Fri, 6 Jan 2023 12:00:57 +0000 Subject: [PATCH] fix(watch-compiler): merge compiler options with config file options --- lib/compiler/watch-compiler.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/compiler/watch-compiler.ts b/lib/compiler/watch-compiler.ts index fc7831dea..9a4ee16c3 100644 --- a/lib/compiler/watch-compiler.ts +++ b/lib/compiler/watch-compiler.ts @@ -30,7 +30,7 @@ export class WatchCompiler { if (!configPath) { throw new Error(CLI_ERRORS.MISSING_TYPESCRIPT(configFilename)); } - const { projectReferences } = + const { options, projectReferences } = this.tsConfigProvider.getByConfigFilename(configFilename); const createProgram = tsBin.createEmitAndSemanticDiagnosticsBuilderProgram; @@ -44,7 +44,10 @@ export class WatchCompiler { ); const host = tsBin.createWatchCompilerHost( configPath, - tsCompilerOptions, + { + ...options, + ...tsCompilerOptions, + }, tsBin.sys, createProgram, this.createDiagnosticReporter(origDiagnosticReporter),