Created by: petetnt
Fixes the most common case of https://github.com/facebook/create-react-app/issues/2956.
This PR changes WebpackDevServer settings to only ignore node_modules
if the resource intensive CHOKIDAR_USEPOLLING
environment variable is set. AFAIK using the said environment variable is the only way to end up poll watching, as CRA itself doesn't explicitly set polling
related options. (edit: wrong, check below)
The PR also ignores the special ignoredFiles
set, as CRA now supports monorepos natively. Instead we ignore all node_modules
folders with a /node_modules/
RegExp. Removing the special case also removes the tests from react-dev-utils
as they were the only related tests to that package.
Not sure if we should also have an escape hatch (like IGNORE_NODE_MODULES_WATCHING
env variable) for cases where native file watching could be too intensive anyway?
Also should we warn the users if polling is enable that the node_modules folder is ignored or is the README notice enough?