Skip to content

Commit 80de217

Browse files
committed
Allow the dev server to watch for changes in src/node_modules
1 parent c003583 commit 80de217

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/react-scripts/config/webpackDevServer.config.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,10 @@ module.exports = function(proxy, allowedHost) {
7272
quiet: true,
7373
// Reportedly, this avoids CPU overload on some systems.
7474
// https://github.com/facebookincubator/create-react-app/issues/293
75+
// src/node_modules is not ignored to support absolute imports
76+
// https://github.com/facebookincubator/create-react-app/issues/1065
7577
watchOptions: {
76-
ignored: /node_modules/,
78+
ignored: new RegExp(`^(?!${paths.appSrc})*[\\\/]node_modules[\\\/]`, 'g'),
7779
},
7880
// Enable HTTPS if the HTTPS environment variable is set to 'true'
7981
https: protocol === 'https',

0 commit comments

Comments
 (0)