31 lines
1021 B
JavaScript
31 lines
1021 B
JavaScript
|
/*
|
||
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
||
|
Author Tobias Koppers @sokra
|
||
|
*/
|
||
|
module.exports = function(updatedModules, renewedModules) {
|
||
|
var unacceptedModules = updatedModules.filter(function(moduleId) {
|
||
|
return renewedModules && renewedModules.indexOf(moduleId) < 0;
|
||
|
});
|
||
|
|
||
|
if(unacceptedModules.length > 0) {
|
||
|
console.warn("[HMR] The following modules couldn't be hot updated: (They would need a full reload!)");
|
||
|
unacceptedModules.forEach(function(moduleId) {
|
||
|
console.warn("[HMR] - " + moduleId);
|
||
|
});
|
||
|
}
|
||
|
|
||
|
if(!renewedModules || renewedModules.length === 0) {
|
||
|
console.log("[HMR] Nothing hot updated.");
|
||
|
} else {
|
||
|
console.log("[HMR] Updated modules:");
|
||
|
renewedModules.forEach(function(moduleId) {
|
||
|
console.log("[HMR] - " + moduleId);
|
||
|
});
|
||
|
var numberIds = renewedModules.every(function(moduleId) {
|
||
|
return typeof moduleId === "number";
|
||
|
});
|
||
|
if(numberIds)
|
||
|
console.log("[HMR] Consider using the NamedModulesPlugin for module names.");
|
||
|
}
|
||
|
};
|