mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: bug fixes
This commit is contained in:
4 files changed
+37
-28
No files matched your search
@@ -158,11 +158,11 @@ export default class HMR extends Service {
|
||||
for (const filename in require.cache) {
|
||||
const module = require.cache[filename];
|
||||
const plugin = unwrapExports(module.exports);
|
||||
if (typeof plugin !== 'object' || !plugin || !('apply' in plugin)) continue;
|
||||
if (!plugin) continue;
|
||||
const runtime = this.ctx.registry.get(plugin);
|
||||
if (!runtime || this.declined.has(filename)) continue;
|
||||
pending.set(filename, plugin);
|
||||
if (!plugin || !('sideEffect' in plugin) || !plugin['sideEffect']) this.declined.add(filename);
|
||||
if (!plugin?.sideEffect) this.declined.add(filename);
|
||||
}
|
||||
|
||||
for (const [filename, plugin] of pending) {
|
||||
|
||||
Reference in new issue
Block a user