diff --git a/packages/react-scripts/config/webpackDevServer.config.js b/packages/react-scripts/config/webpackDevServer.config.js index 25b42d0de8b..a1d3c34380b 100644 --- a/packages/react-scripts/config/webpackDevServer.config.js +++ b/packages/react-scripts/config/webpackDevServer.config.js @@ -72,8 +72,10 @@ module.exports = function(proxy, allowedHost) { quiet: true, // Reportedly, this avoids CPU overload on some systems. // https://github.com/facebookincubator/create-react-app/issues/293 + // src/node_modules is not ignored to support absolute imports + // https://github.com/facebookincubator/create-react-app/issues/1065 watchOptions: { - ignored: /node_modules/, + ignored: new RegExp(`^(?!${paths.appSrc})*[\\\/]node_modules[\\\/]`, 'g'), }, // Enable HTTPS if the HTTPS environment variable is set to 'true' https: protocol === 'https',