Treat package.json's first

Reviewed By: fkgozali

Differential Revision: D5736600

fbshipit-source-id: f2947d4b1fb057ea33dd84e3c8cd878d5bfeda49
This commit is contained in:
Miguel Jimenez Esun 2017-08-30 11:56:20 -07:00 committed by Facebook Github Bot
parent 909480887e
commit 9254941133
1 changed files with 4 additions and 3 deletions

View File

@ -76,11 +76,12 @@ class HasteMap<TModule: Moduleish, TPackage: Packageish> extends EventEmitter {
const promises = [];
this._files.forEach(filePath => {
if (!this._helpers.isNodeModulesDir(filePath)) {
if (this._extensions.indexOf(path.extname(filePath).substr(1)) !== -1) {
promises.push(this._processHasteModule(filePath));
}
if (filePath.endsWith(PACKAGE_JSON)) {
promises.push(this._processHastePackage(filePath));
} else if (
this._extensions.indexOf(path.extname(filePath).substr(1)) !== -1
) {
promises.push(this._processHasteModule(filePath));
}
}
});