You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
430 B
16 lines
430 B
7 years ago
|
/**
|
||
|
* Loop through webpack entry
|
||
|
* and add the hot middleware
|
||
|
* @param {Object} entry webpack entry
|
||
|
* @return {Object} entry with hot middleware
|
||
|
*/
|
||
|
module.exports = (entry) => {
|
||
|
const results = {};
|
||
|
|
||
|
Object.keys(entry).forEach((name) => {
|
||
|
results[name] = Array.isArray(entry[name]) ? entry[name].slice(0) : [entry[name]];
|
||
|
results[name].unshift(`${__dirname}/../helpers/hmr-client.js`);
|
||
|
});
|
||
|
return results;
|
||
|
};
|