UNPKG

485 BJavaScriptView Raw
1/**
2 * Handler for done event
3 * @param data - the configuration index of the completed webpack run
4 */
5module.exports = function watchDoneHandler(callback, ipc, configIndices, data) {
6 // Once every configuration has completed once, stop the server and invoke the callback
7 configIndices.splice(configIndices.indexOf(data), 1);
8 if (!configIndices.length) {
9 ipc.server.stop();
10
11 if (typeof callback === 'function') {
12 callback();
13 }
14 }
15};