diff --git a/packages/metro-bundler/src/JSTransformer/worker/extract-dependencies.js b/packages/metro-bundler/src/JSTransformer/worker/extract-dependencies.js index 024855dc..1fbe706e 100644 --- a/packages/metro-bundler/src/JSTransformer/worker/extract-dependencies.js +++ b/packages/metro-bundler/src/JSTransformer/worker/extract-dependencies.js @@ -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 = [];