Skip to content

Commit

Permalink
Don't watch node_modules
Browse files Browse the repository at this point in the history
Reduce CPU and memory usage.

Context: https://webpack.js.org/configuration/watch/#watchoptionsignored

More context: the reason live reloading was failing for me was not enough watchers: https://webpack.js.org/configuration/watch/#not-enough-watchers

I fixed it by increasing my max watchers, but while digging found that we were watching node_modules and don't need to.
  • Loading branch information
rachel-fenichel authored Apr 21, 2020
1 parent df7607f commit f71a775
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plugins/dev-scripts/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ module.exports = (env) => {
const devServer = {
port: 3000,
host: '0.0.0.0',
watchOptions: {
ignored: /node_modules/,
},
};
if (env.buildTest) {
devServer.openPage = 'test';
Expand Down

0 comments on commit f71a775

Please sign in to comment.