Skip to content

Commit

Permalink
Allow the dev server to watch for changes in src/node_modules
Browse files Browse the repository at this point in the history
This allows users to put a `node_modules` folder in `src` if they want to use absolute imports
or imitate the webpack `resolve.alias` config.
  • Loading branch information
bmac committed Jul 10, 2017
1 parent 3ca6bae commit cf6ad23
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/react-scripts/config/webpackDevServer.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,12 @@ module.exports = function(proxy, allowedHost) {
// WebpackDevServer is noisy by default so we emit custom message instead
// by listening to the compiler events with `compiler.plugin` calls above.
quiet: true,
// Reportedly, this avoids CPU overload on some systems.
// Reportedly, ignoring node_modules 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: /^([^\/]|\/(?!src))*\/node_modules\//,
},
// Enable HTTPS if the HTTPS environment variable is set to 'true'
https: protocol === 'https',
Expand Down

0 comments on commit cf6ad23

Please sign in to comment.