fix(core): Fix hot-reload that broke after chokidar upgrade (no-changelog) (#11658)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-11-08 16:54:06 +01:00
committed by GitHub
parent 9b6123dfb2
commit fb06b55211

View File

@@ -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);
});
}
}