From e384e4ebc214489a1424f7bb7e67d5efb54304eb Mon Sep 17 00:00:00 2001 From: bojiang Date: Fri, 2 Sep 2022 09:46:09 +0800 Subject: [PATCH] jiangbo91@huawei.com Signed-off-by: bojiang Change-Id: I0551d3ecf79d2106f1ade966b5536a2ace042cbd --- 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 affb5f9..b9c116e 100644 --- a/compiler/src/compile_info.ts +++ b/compiler/src/compile_info.ts @@ -200,6 +200,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'; + } + } + }); + if (!projectConfig.isPreview) { compiler.hooks.compilation.tap('Collect Components And Modules', compilation => { compilation.hooks.additionalAssets.tapAsync('Collect Components And Modules', callback => {