mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-04-24 05:05:53 +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
packages/react-dev-utils/getProcessForPort.js
vendored
10
packages/react-dev-utils/getProcessForPort.js
vendored
@@ -46,7 +46,7 @@ function getProcessCommand(processId, processDirectory) {
|
||||
execOptions
|
||||
);
|
||||
|
||||
command = command.replace(/\n$/, '')
|
||||
command = command.replace(/\n$/, '');
|
||||
|
||||
if (isProcessAReactApp(command)) {
|
||||
const packageName = getPackageNameInDirectory(processDirectory);
|
||||
@@ -68,8 +68,12 @@ function getProcessForPort(port) {
|
||||
var processId = getProcessIdOnPort(port);
|
||||
var directory = getDirectoryOfProcessById(processId);
|
||||
var command = getProcessCommand(processId, directory);
|
||||
return chalk.cyan(command) + chalk.grey(' (pid ' + processId + ')\n') +
|
||||
chalk.blue(' in ') + chalk.cyan(directory);
|
||||
return (
|
||||
chalk.cyan(command) +
|
||||
chalk.grey(' (pid ' + processId + ')\n') +
|
||||
chalk.blue(' in ') +
|
||||
chalk.cyan(directory)
|
||||
);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user