Sha256: 0bcc2205aa64097aa10d13f4401643b938eb5269e0420bce5babe56380fbcc1e

Contents?: true

Size: 1.13 KB

Versions: 7

Compression:

Stored size: 1.13 KB

Contents

/*
	MIT License http://www.opensource.org/licenses/mit-license.php
	Author Tobias Koppers @sokra
*/
/*globals __resourceQuery */
if(module.hot) {
	var hotPollInterval = +(__resourceQuery.substr(1)) || (10 * 60 * 1000);
	var log = require("./log");

	var checkForUpdate = function checkForUpdate(fromUpdate) {
		if(module.hot.status() === "idle") {
			module.hot.check(true).then(function(updatedModules) {
				if(!updatedModules) {
					if(fromUpdate) log("info", "[HMR] Update applied.");
					return;
				}
				require("./log-apply-result")(updatedModules, updatedModules);
				checkForUpdate(true);
			}).catch(function(err) {
				var status = module.hot.status();
				if(["abort", "fail"].indexOf(status) >= 0) {
					log("warning", "[HMR] Cannot apply update.");
					log("warning", "[HMR] " + err.stack || err.message);
					log("warning", "[HMR] You need to restart the application!");
				} else {
					log("warning", "[HMR] Update failed: " + err.stack || err.message);
				}
			});
		}
	};
	setInterval(checkForUpdate, hotPollInterval);
} else {
	throw new Error("[HMR] Hot Module Replacement is disabled.");
}

Version data entries

7 entries across 3 versions & 2 rubygems

Version Path
optimacms-0.4.3 spec/dummy/node_modules/webpack/hot/poll.js
optimacms-0.4.3 spec/dummy/node_modules/@rails/webpacker/node_modules/webpack/hot/poll.js
optimacms-0.4.3 spec/dummy/node_modules/@rails/webpacker/node_modules/webpack/node_modules/webpack/hot/poll.js
optimacms-0.4.2 spec/dummy/node_modules/webpack/hot/poll.js
optimacms-0.4.2 spec/dummy/node_modules/@rails/webpacker/node_modules/webpack/hot/poll.js
optimacms-0.4.2 spec/dummy/node_modules/@rails/webpacker/node_modules/webpack/node_modules/webpack/hot/poll.js
cortex-0.1.3 spec/dummy/node_modules/webpack/hot/poll.js