Fix bundler to not do as many passes in optimization

Reviewed By: davidaurelio

Differential Revision: D2876894

fb-gh-sync-id: b652ff77dd442a82c16f3b446c931fb985a2efcd
This commit is contained in:
Dave Miller 2016-01-28 16:35:56 -08:00 committed by facebook-github-bot-0
parent 9fb1762784
commit 82d4cbe7dd
1 changed files with 3 additions and 1 deletions

View File

@ -135,10 +135,12 @@ module.exports = function () {
visitor: {
Program(path) {
path.traverse(firstPass);
while (hasDeadModules(requires)) {
var counter = 0;
while (hasDeadModules(requires) && counter < 3) {
_requires = requires;
requires = {};
path.traverse(secondPass);
counter++;
}
}
}