Skip to content Skip to sidebar Skip to footer

Infinite Webpack Watch Loop - How To Ignore Changes To .js Files, Etc

My webpack -w command using ts-loader is in an infinite loop. I am guessing it's because webpack -w is seeing changes to .js files, so that causes the loop: webpack -w => ts tr

Solution 1:

Add this to your webpack.config.js:

// at the top:constWatchIgnorePlugin = require('watch-ignore-webpack-plugin');

 ...

plugins: newWatchIgnorePlugin([/your-ignored-file\.js/]),

Reference: https://webpack.js.org/plugins/watch-ignore-plugin/

It also requires npm install --save --dev watch-ignore-webpack-plugin.

Post a Comment for "Infinite Webpack Watch Loop - How To Ignore Changes To .js Files, Etc"