mirror of
https://github.com/status-im/metro.git
synced 2025-02-13 19:46:37 +00:00
Check for inverseDependencies existance before calling HMR
Differential Revision: D6449768 fbshipit-source-id: d9fe8b54fec0754ffb8ce2db1e87f180862a57a3
This commit is contained in:
parent
8cf97e332f
commit
5d76d340e5
@ -72,9 +72,15 @@ function define(
|
|||||||
// named parameter in `define` in production.
|
// named parameter in `define` in production.
|
||||||
const inverseDependencies = arguments[4];
|
const inverseDependencies = arguments[4];
|
||||||
|
|
||||||
// If the module has already been defined and we're in dev mode,
|
// If the module has already been defined and the define method has been
|
||||||
// hot reload it.
|
// called with inverseDependencies, we can hot reload it.
|
||||||
|
if (inverseDependencies) {
|
||||||
global.__accept(moduleId, factory, dependencyMap, inverseDependencies);
|
global.__accept(moduleId, factory, dependencyMap, inverseDependencies);
|
||||||
|
} else {
|
||||||
|
console.warn(
|
||||||
|
`Trying to define twice module ID ${moduleId} in the same bundle`,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// prevent repeated calls to `global.nativeRequire` to overwrite modules
|
// prevent repeated calls to `global.nativeRequire` to overwrite modules
|
||||||
|
Loading…
x
Reference in New Issue
Block a user