mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
core: watcher: fix hydrojudge hot-reload
This commit is contained in:
1 parent
db0bcbac8f
commit
f77dd8dc98
1 file changed
+2
-1
@@ -152,10 +152,11 @@ export default class Watcher extends Service {
|
||||
for (const filename in require.cache) {
|
||||
const module = require.cache[filename];
|
||||
const plugin = unwrapExports(module.exports);
|
||||
if (!(typeof plugin === 'object' && 'apply' in plugin)) continue;
|
||||
const runtime = this.ctx.registry.get(plugin);
|
||||
if (!runtime || this.declined.has(filename)) continue;
|
||||
pending.set(filename, runtime);
|
||||
if (!plugin?.['sideEffect']) this.declined.add(filename);
|
||||
if (!(plugin && 'sideEffect' in plugin && plugin['sideEffect'])) this.declined.add(filename);
|
||||
}
|
||||
|
||||
for (const [filename, runtime] of pending) {
|
||||
|
||||
Reference in new issue
Block a user