Skip to content

Commit

Permalink
Watch for changes in src/**/node_modules (facebook#3230)
Browse files Browse the repository at this point in the history
* Allow the dev server to watch for changes in src/node_modules

* fix eslint error

* fix broken regex

* handle trailing slash edge case for file paths

Closes facebook#2760
Fixes facebook#3223
  • Loading branch information
xjlim authored and Timer committed Oct 3, 2017
1 parent 0dba748 commit 3dae2d8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion config/webpackDevServer.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

const errorOverlayMiddleware = require('react-dev-utils/errorOverlayMiddleware');
const noopServiceWorkerMiddleware = require('react-dev-utils/noopServiceWorkerMiddleware');
const path = require('path');
const config = require('./webpack.config.dev');
const paths = require('./paths');

Expand Down Expand Up @@ -72,8 +73,13 @@ 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(
`^(?!${path.normalize(paths.appSrc + '/')}).+[\\/]node_modules[\\/]`,
'g'
),
},
// Enable HTTPS if the HTTPS environment variable is set to 'true'
https: protocol === 'https',
Expand Down

0 comments on commit 3dae2d8

Please sign in to comment.