From 65682cc112c4020e435ab6a7f42abe762e337bc4 Mon Sep 17 00:00:00 2001 From: bojiang Date: Fri, 2 Sep 2022 10:22:38 +0800 Subject: [PATCH] fixed 1d220b2 from https://gitee.com/BoJiang4702/developtools_ace-ets2bundle/pulls/1047 jiangbo91@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 解决ets工程引用js文件watch模式下修改js文件内容预览器无法刷新 Signed-off-by: bojiang Change-Id: I7b0f2d9636cbe054fc12dd5283954cec357c169e --- compiler/src/compile_info.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/compiler/src/compile_info.ts b/compiler/src/compile_info.ts index 681f5f6..16b2ba4 100644 --- a/compiler/src/compile_info.ts +++ b/compiler/src/compile_info.ts @@ -239,6 +239,17 @@ export class ResultStates { } this.printResult(); }); + + compiler.hooks.watchRun.tap('Listening State', (compiler: Compiler) => { + if (compiler.modifiedFiles) { + const isTsAndEtsFile: boolean = [...compiler.modifiedFiles].some((item: string) => { + return /.(ts|ets)$/.test(item); + }); + if (!isTsAndEtsFile) { + process.env.watchTs = 'end'; + } + } + }); } private printDiagnostic(diagnostic: ts.Diagnostic): void {