thread-loader's 'poolTimeout' should be overridden when watching
Created by: edmorley
Hi!
Currently create-react-app uses thread-loader with default options in both the development and production configs: https://github.com/facebook/create-react-app/blob/bf3d73c2c6fd78d4eea23f5356fb26f3232fabee/packages/react-scripts/config/webpack.config.dev.js#L211-L213 https://github.com/facebook/create-react-app/blob/bf3d73c2c6fd78d4eea23f5356fb26f3232fabee/packages/react-scripts/config/webpack.config.prod.js#L237-L239
The production usage is fine, however as mentioned here, when watching is enabled (ie the development config with webpack-dev-server) the poolTimeout
option should be changed from its default of 500
ms to Infinity
to avoid paying the overhead of worker startup on every rebuild.
See: https://github.com/webpack-contrib/thread-loader#examples