diff --git a/packages/metro-bundler/src/ModuleGraph/node-haste/node-haste.js b/packages/metro-bundler/src/ModuleGraph/node-haste/node-haste.js index ac93bde1..38fc8799 100644 --- a/packages/metro-bundler/src/ModuleGraph/node-haste/node-haste.js +++ b/packages/metro-bundler/src/ModuleGraph/node-haste/node-haste.js @@ -119,7 +119,6 @@ exports.createResolveFn = function(options: ResolveOptions): ResolveFn { moduleCache, moduleMap: getFakeModuleMap(hasteMap), platform, - platforms, preferNativePlatform: true, sourceExts, }); diff --git a/packages/metro-bundler/src/node-haste/DependencyGraph.js b/packages/metro-bundler/src/node-haste/DependencyGraph.js index 89e05218..bade0b2c 100644 --- a/packages/metro-bundler/src/node-haste/DependencyGraph.js +++ b/packages/metro-bundler/src/node-haste/DependencyGraph.js @@ -233,7 +233,6 @@ class DependencyGraph extends EventEmitter { moduleCache: this._moduleCache, moduleMap: this._moduleMap, platform, - platforms: this._opts.platforms, preferNativePlatform: this._opts.preferNativePlatform, sourceExts: this._opts.sourceExts, }); diff --git a/packages/metro-bundler/src/node-haste/DependencyGraph/ResolutionRequest.js b/packages/metro-bundler/src/node-haste/DependencyGraph/ResolutionRequest.js index e667cd7c..7118f545 100644 --- a/packages/metro-bundler/src/node-haste/DependencyGraph/ResolutionRequest.js +++ b/packages/metro-bundler/src/node-haste/DependencyGraph/ResolutionRequest.js @@ -88,7 +88,6 @@ type Options = {| +moduleCache: ModuleishCache, +moduleMap: ModuleMap, +platform: ?string, - +platforms: Set, +preferNativePlatform: boolean, +sourceExts: Array, |}; @@ -109,6 +108,8 @@ function tryResolveSync(action: () => T, secondaryAction: () => T): T { } } +const EMPTY_SET = new Set(); + class ResolutionRequest { _doesFileExist = filePath => this._options.hasteFS.exists(filePath); _immediateResolutionCache: {[key: string]: TModule}; @@ -613,10 +614,7 @@ class ResolutionRequest { fromModule: TModule, toModule: string, ): TModule { - const {name, type} = getAssetDataFromName( - potentialModulePath, - this._options.platforms, - ); + const {name, type} = getAssetDataFromName(potentialModulePath, EMPTY_SET); let pattern = '^' + name + '(@[\\d\\.]+x)?'; if (this._options.platform != null) {