Make bablyon parse files in module mode

Reviewed By: davidaurelio

Differential Revision: D6008659

fbshipit-source-id: 6ec3a5e1470e91208a6e71eeca3a2f7c5e755acf
This commit is contained in:
Burak Yigit Kaya 2017-10-09 10:21:57 -07:00 committed by Facebook Github Bot
parent b2002609c1
commit 9f8d4ad4fe
1 changed files with 1 additions and 1 deletions

View File

@ -29,7 +29,7 @@ const babylon = require('babylon');
* but it's a tradeoff for simplicity.
*/
function extractDependencies(code: string) {
const ast = babylon.parse(code);
const ast = babylon.parse(code, {sourceType: 'module'});
const dependencies = new Set();
const dependencyOffsets = [];