mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-04-28 09:25:42 +08:00
Watch for changes in src/**/node_modules (#3230)
* 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 #2760 Fixes #3223
This commit is contained in:
@@ -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');
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user