webpack/test/hotCases/update.js

15 lines
345 B
JavaScript
Raw Normal View History

2021-05-27 04:49:07 +08:00
module.exports = function (done, options, callback) {
return function (err, stats) {
if (err) return done(err);
2021-05-27 04:49:07 +08:00
module.hot
.check(options || true)
.then(updatedModules => {
if (!updatedModules) return done(new Error("No update available"));
if (callback) callback(stats);
})
.catch(err => {
done(err);
});
};
2015-11-01 23:11:35 +08:00
};