Skip to content

Commit e5e235a

Browse files
xjlimTimer
authored andcommittedNov 4, 2017
Refactor extra watch options regex to react-dev-utils (facebook#3362)
* extra watch options regex to react-dev-utils * fix regex * add test * fix eslint error * include react-dev-utils test in CI script * attempt to fix import error * attempt to fix error on CI * Update .eslintrc
1 parent 50cfacd commit e5e235a

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed
 

‎config/webpack.config.prod.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ module.exports = {
301301
},
302302
mangle: {
303303
safari10: true,
304-
},
304+
},
305305
output: {
306306
comments: false,
307307
// Turned on because emoji and regex is not minified properly using default

‎config/webpackDevServer.config.js

+2-7
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
const errorOverlayMiddleware = require('react-dev-utils/errorOverlayMiddleware');
1212
const noopServiceWorkerMiddleware = require('react-dev-utils/noopServiceWorkerMiddleware');
13-
const path = require('path');
13+
const ignoredFiles = require('react-dev-utils/ignoredFiles');
1414
const config = require('./webpack.config.dev');
1515
const paths = require('./paths');
1616

@@ -76,12 +76,7 @@ module.exports = function(proxy, allowedHost) {
7676
// src/node_modules is not ignored to support absolute imports
7777
// https://github.com/facebookincubator/create-react-app/issues/1065
7878
watchOptions: {
79-
ignored: new RegExp(
80-
`^(?!${path
81-
.normalize(paths.appSrc + '/')
82-
.replace(/[\\]+/g, '\\\\')}).+[\\\\/]node_modules[\\\\/]`,
83-
'g'
84-
),
79+
ignored: ignoredFiles(paths.appSrc),
8580
},
8681
// Enable HTTPS if the HTTPS environment variable is set to 'true'
8782
https: protocol === 'https',

0 commit comments

Comments
 (0)