From fb06b55211b5ebed9feceea28a75b1c51227ddbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Fri, 8 Nov 2024 16:54:06 +0100 Subject: [PATCH] fix(core): Fix hot-reload that broke after chokidar upgrade (no-changelog) (#11658) --- packages/cli/src/load-nodes-and-credentials.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/load-nodes-and-credentials.ts b/packages/cli/src/load-nodes-and-credentials.ts index a5cff3764f..22273fb894 100644 --- a/packages/cli/src/load-nodes-and-credentials.ts +++ b/packages/cli/src/load-nodes-and-credentials.ts @@ -390,7 +390,15 @@ export class LoadNodesAndCredentials { const toWatch = loader.isLazyLoaded ? ['**/nodes.json', '**/credentials.json'] : ['**/*.js', '**/*.json']; - watch(toWatch, { cwd: realModulePath }).on('change', reloader); + const files = await glob(toWatch, { + cwd: realModulePath, + ignore: ['node_modules/**'], + }); + const watcher = watch(files, { + cwd: realModulePath, + ignoreInitial: true, + }); + watcher.on('add', reloader).on('change', reloader).on('unlink', reloader); }); } }