Don't extract dependencies from .json files

Reviewed By: davidaurelio

Differential Revision: D2832417

fb-gh-sync-id: 8bf3705bf620f3cc6d713ca08dde52464185797a
This commit is contained in:
Christoph Pojer 2016-01-15 10:05:20 -08:00 committed by facebook-github-bot-9
parent fb94be4358
commit a258d55716
1 changed files with 4 additions and 3 deletions

View File

@ -109,10 +109,11 @@ class Module {
)[1];
}
// Ignore requires in generated code. An example of this is prebuilt
// files like the SourceMap library.
if ('extern' in moduleDocBlock) {
// Ignore requires in JSON files or generated code. An example of this
// is prebuilt files like the SourceMap library.
if (this.isJSON() || 'extern' in moduleDocBlock) {
data.dependencies = [];
data.asyncDependencies = [];
} else {
var dependencies = (this._extractor || extractRequires)(content).deps;
data.dependencies = dependencies.sync;