mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
38 lines
786 B
JavaScript
38 lines
786 B
JavaScript
let enabled = __meteor_runtime_config__ &&
|
|
__meteor_runtime_config__.reactFastRefreshEnabled;
|
|
let hmrEnabled = !!module.hot;
|
|
var setupModule;
|
|
|
|
function init(module) {
|
|
if (!hmrEnabled) {
|
|
return;
|
|
}
|
|
|
|
setupModule = setupModule || require('./client-runtime.js');
|
|
setupModule(module);
|
|
}
|
|
|
|
if (
|
|
hmrEnabled &&
|
|
enabled
|
|
) {
|
|
let inBefore = false;
|
|
module.hot.onRequire({
|
|
before: function (module) {
|
|
if (inBefore) {
|
|
// This is a module required while loading the react refresh runtime
|
|
// Do not initialize it to avoid an infinite loop
|
|
return;
|
|
}
|
|
|
|
inBefore = true;
|
|
init(module);
|
|
inBefore = false;
|
|
}
|
|
});
|
|
|
|
window.___INIT_METEOR_FAST_REFRESH = function () {};
|
|
} else {
|
|
window.___INIT_METEOR_FAST_REFRESH = init;
|
|
}
|