Skip to content

Commit

Permalink
Don't extract dependencies from .json files
Browse files Browse the repository at this point in the history
Reviewed By: davidaurelio

Differential Revision: D2832417

fb-gh-sync-id: 8bf3705bf620f3cc6d713ca08dde52464185797a
  • Loading branch information
cpojer authored and facebook-github-bot-9 committed Jan 15, 2016
1 parent a10a510 commit dd06596
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packager/react-packager/src/DependencyResolver/Module.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit dd06596

Please sign in to comment.