source: imaps-frontend/node_modules/webpack/hot/dev-server.js

main
Last change on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 1.9 KB
Line 
1/*
2 MIT License http://www.opensource.org/licenses/mit-license.php
3 Author Tobias Koppers @sokra
4*/
5/* globals __webpack_hash__ */
6if (module.hot) {
7 /** @type {undefined|string} */
8 var lastHash;
9 var upToDate = function upToDate() {
10 return /** @type {string} */ (lastHash).indexOf(__webpack_hash__) >= 0;
11 };
12 var log = require("./log");
13 var check = function check() {
14 module.hot
15 .check(true)
16 .then(function (updatedModules) {
17 if (!updatedModules) {
18 log(
19 "warning",
20 "[HMR] Cannot find update. " +
21 (typeof window !== "undefined"
22 ? "Need to do a full reload!"
23 : "Please reload manually!")
24 );
25 log(
26 "warning",
27 "[HMR] (Probably because of restarting the webpack-dev-server)"
28 );
29 if (typeof window !== "undefined") {
30 window.location.reload();
31 }
32 return;
33 }
34
35 if (!upToDate()) {
36 check();
37 }
38
39 require("./log-apply-result")(updatedModules, updatedModules);
40
41 if (upToDate()) {
42 log("info", "[HMR] App is up to date.");
43 }
44 })
45 .catch(function (err) {
46 var status = module.hot.status();
47 if (["abort", "fail"].indexOf(status) >= 0) {
48 log(
49 "warning",
50 "[HMR] Cannot apply update. " +
51 (typeof window !== "undefined"
52 ? "Need to do a full reload!"
53 : "Please reload manually!")
54 );
55 log("warning", "[HMR] " + log.formatError(err));
56 if (typeof window !== "undefined") {
57 window.location.reload();
58 }
59 } else {
60 log("warning", "[HMR] Update failed: " + log.formatError(err));
61 }
62 });
63 };
64 var hotEmitter = require("./emitter");
65 hotEmitter.on("webpackHotUpdate", function (currentHash) {
66 lastHash = currentHash;
67 if (!upToDate() && module.hot.status() === "idle") {
68 log("info", "[HMR] Checking for updates on the server...");
69 check();
70 }
71 });
72 log("info", "[HMR] Waiting for update signal from WDS...");
73} else {
74 throw new Error("[HMR] Hot Module Replacement is disabled.");
75}
Note: See TracBrowser for help on using the repository browser.