From 21ccd2b2699e7996ed2f800a002b9555f016d208 Mon Sep 17 00:00:00 2001 From: Miguel Jimenez Esun Date: Mon, 19 Mar 2018 05:11:07 -0700 Subject: [PATCH] Remove things that contain absolute paths Reviewed By: rafeca Differential Revision: D7306933 fbshipit-source-id: 497b0f6f71243180870a297d6ea8b09164112649 --- packages/metro/src/Bundler/index.js | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/packages/metro/src/Bundler/index.js b/packages/metro/src/Bundler/index.js index e5c5a1a5..1f7b4fb0 100644 --- a/packages/metro/src/Bundler/index.js +++ b/packages/metro/src/Bundler/index.js @@ -121,6 +121,14 @@ class Bundler { constructor(opts: Options) { opts.projectRoots.forEach(verifyRootExists); + const getTransformCacheKey = getTransformCacheKeyFn({ + asyncRequireModulePath: opts.asyncRequireModulePath, + cacheVersion: opts.cacheVersion, + dynamicDepsInPackages: opts.dynamicDepsInPackages, + projectRoots: opts.projectRoots, + transformModulePath: opts.transformModulePath, + }); + this._opts = opts; this._cache = opts.cacheStores.length ? new Cache(opts.cacheStores) : null; @@ -147,13 +155,7 @@ class Bundler { experimentalCaches: !!opts.cacheStores.length, extraNodeModules: opts.extraNodeModules, getPolyfills: opts.getPolyfills, - getTransformCacheKey: getTransformCacheKeyFn({ - asyncRequireModulePath: opts.asyncRequireModulePath, - cacheVersion: opts.cacheVersion, - dynamicDepsInPackages: opts.dynamicDepsInPackages, - projectRoots: opts.projectRoots, - transformModulePath: opts.transformModulePath, - }), + getTransformCacheKey, globalTransformCache: opts.globalTransformCache, hasteImplModulePath: opts.hasteImplModulePath, maxWorkers: opts.maxWorkers, @@ -173,11 +175,7 @@ class Bundler { this._baseHash = stableHash([ opts.assetExts, opts.assetRegistryPath, - opts.asyncRequireModulePath, - opts.cacheVersion, - opts.dynamicDepsInPackages, - opts.projectRoots, - opts.transformModulePath, + getTransformCacheKey, ]).toString('binary'); this._projectRoots = opts.projectRoots;