diff --git a/webpack.config.default.js b/webpack.config.default.js index 4efc4961e..d57318150 100644 --- a/webpack.config.default.js +++ b/webpack.config.default.js @@ -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 = {