MCPcopy
hub / github.com/webpack/webpack / check

Function check

hot/dev-server.js:15–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13 };
14 var log = require("./log");
15 var check = function check() {
16 module.hot
17 .check(true)
18 .then(function (updatedModules) {
19 if (!updatedModules) {
20 log(
21 "warning",
22 "[HMR] Cannot find update. " +
23 (typeof window !== "undefined"
24 ? "Need to do a full reload!"
25 : "Please reload manually!")
26 );
27 log(
28 "warning",
29 "[HMR] (Probably because of restarting the webpack-dev-server)"
30 );
31 if (typeof window !== "undefined") {
32 window.location.reload();
33 }
34 return;
35 }
36
37 if (!upToDate()) {
38 check();
39 }
40
41 require("./log-apply-result")(updatedModules, updatedModules);
42
43 if (upToDate()) {
44 log("info", "[HMR] App is up to date.");
45 }
46 })
47 .catch(function (err) {
48 var status = module.hot.status();
49 if (["abort", "fail"].indexOf(status) >= 0) {
50 log(
51 "warning",
52 "[HMR] Cannot apply update. " +
53 (typeof window !== "undefined"
54 ? "Need to do a full reload!"
55 : "Please reload manually!")
56 );
57 log("warning", "[HMR] " + log.formatError(err));
58 if (typeof window !== "undefined") {
59 window.location.reload();
60 }
61 } else {
62 log("warning", "[HMR] Update failed: " + log.formatError(err));
63 }
64 });
65 };
66 /** @type {EventTarget | NodeJS.EventEmitter} */
67 var hotEmitter = require("./emitter");
68 /**

Callers 2

handlerFunction · 0.70
validateMethod · 0.50

Calls 5

upToDateFunction · 0.70
checkMethod · 0.65
statusMethod · 0.65
logFunction · 0.50
requireFunction · 0.50

Tested by

no test coverage detected