Improvements to the packager for very large projects

Summary:
Here are some small fixes for issues we've encountered with very large RN projects (mostly huge dependency trees in `node_modules`).

cc amasad martinbigio
Closes https://github.com/facebook/react-native/pull/4880

Reviewed By: svcscm

Differential Revision: D2782834

Pulled By: mkonicek

fb-gh-sync-id: e316a62b84ba796b80ac819431414ebf27f7b566
This commit is contained in:
Philipp von Weitershausen 2015-12-22 15:16:46 -08:00 committed by facebook-github-bot-3
parent c74d6403f5
commit 1b80007236
3 changed files with 7 additions and 3 deletions

View File

@ -49,6 +49,10 @@ function runServer(args, config, readyCallback) {
readyCallback();
}
);
// Disable any kind of automatic timeout behavior for incoming
// requests in case it takes the packager more than the default
// timeout of 120 seconds to respond to a request.
serverInstance.timeout = 0;
}
function getAppMiddleware(args, config) {

View File

@ -13,7 +13,7 @@ const sane = require('sane');
const Promise = require('promise');
const exec = require('child_process').exec;
const MAX_WAIT_TIME = 25000;
const MAX_WAIT_TIME = 120000;
// TODO(amasad): can we use watchman version command instead?
const detectingWatcherClass = new Promise(function(resolve) {

View File

@ -293,11 +293,11 @@ class File {
}
getFiles() {
const files = [];
let files = [];
Object.keys(this.children).forEach(key => {
const file = this.children[key];
if (file.isDir) {
files.push(...file.getFiles());
files = files.concat(file.getFiles());
} else {
files.push(file);
}