mirror of https://github.com/status-im/metro.git
Make bablyon parse files in module mode
Reviewed By: davidaurelio Differential Revision: D6008659 fbshipit-source-id: 6ec3a5e1470e91208a6e71eeca3a2f7c5e755acf
This commit is contained in:
parent
b2002609c1
commit
9f8d4ad4fe
|
@ -29,7 +29,7 @@ const babylon = require('babylon');
|
||||||
* but it's a tradeoff for simplicity.
|
* but it's a tradeoff for simplicity.
|
||||||
*/
|
*/
|
||||||
function extractDependencies(code: string) {
|
function extractDependencies(code: string) {
|
||||||
const ast = babylon.parse(code);
|
const ast = babylon.parse(code, {sourceType: 'module'});
|
||||||
const dependencies = new Set();
|
const dependencies = new Set();
|
||||||
const dependencyOffsets = [];
|
const dependencyOffsets = [];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue