Skip to content

Commit

Permalink
Merge pull request #279 from hidden4003/webui-v2
Browse files Browse the repository at this point in the history
fix webpack watch rebuild loop
  • Loading branch information
hidden4003 authored Feb 4, 2022
2 parents 5b977ac + 904e50e commit 36bc214
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions webpack.config.default.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,31 @@ if (!isDebug) {
}

if (isDebug && useHMR) {
/*
class WatchRunPlugin {
apply(compiler) {
compiler.hooks.watchRun.tap('WatchRun', (comp) => {
if (comp.modifiedFiles) {
const changedFiles = Array.from(comp.modifiedFiles, (file) => `\n ${file}`).join('');
console.log('===============================');
console.log('FILES CHANGED:', changedFiles);
console.log('===============================');
}
if (comp.removedFiles) {
const removedFiles = Array.from(comp.removedFiles, (file) => `\n ${file}`).join('');
console.log('===============================');
console.log('FILES REMOVED:', removedFiles);
console.log('===============================');
}
//console.log(comp)
});
}
}
config.plugins.push(new WatchRunPlugin);
*/
config.watchOptions = {
ignored: /public/, //because sass-loader causes rebuild loop otherwise
};
config.entry.unshift('webpack-hot-middleware/client');
config.plugins.push(new webpack.HotModuleReplacementPlugin());
config.optimization = {
Expand Down

0 comments on commit 36bc214

Please sign in to comment.