From 179a95e2de48129181f3b4f283c649a9cbbc14fd Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Wed, 13 Jul 2022 19:25:17 +0800 Subject: [PATCH] cli: filter js and map --- doric-cli/src/dev.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doric-cli/src/dev.ts b/doric-cli/src/dev.ts index 5b705371..a50f91a7 100644 --- a/doric-cli/src/dev.ts +++ b/doric-cli/src/dev.ts @@ -41,6 +41,9 @@ export default async function dev() { alwaysStat: true, }) .on("change", (jsFile) => { + if (!jsFile.endsWith(".js") && !jsFile.endsWith(".map")) { + return; + } const content = fs.readFileSync(jsFile, "utf-8"); if (cachedContents[jsFile]) { if (content.indexOf(cachedContents[jsFile]) >= 0) {