From f71a775bd11cc4e5bbaf77c91ec44c26cc9de43d Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Mon, 20 Apr 2020 19:09:44 -0700 Subject: [PATCH] Don't watch node_modules 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. --- plugins/dev-scripts/config/webpack.config.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/dev-scripts/config/webpack.config.js b/plugins/dev-scripts/config/webpack.config.js index 08b3a2e23c..cd980b29be 100644 --- a/plugins/dev-scripts/config/webpack.config.js +++ b/plugins/dev-scripts/config/webpack.config.js @@ -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';