From 941b25a2cadcc09fa52104ba67eb8d9f8992c833 Mon Sep 17 00:00:00 2001 From: Rafael Oleza Date: Wed, 18 Oct 2017 12:10:09 -0700 Subject: [PATCH] Ignore some irrelevant URL params in order to calculate the bundle cache Reviewed By: davidaurelio Differential Revision: D6086420 fbshipit-source-id: 52c1d5dc53d23b3963e663f4033446344b892659 --- packages/metro-bundler/src/Server/index.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/metro-bundler/src/Server/index.js b/packages/metro-bundler/src/Server/index.js index 8a280793..f74072da 100644 --- a/packages/metro-bundler/src/Server/index.js +++ b/packages/metro-bundler/src/Server/index.js @@ -608,8 +608,15 @@ class Server { } optionsHash(options: {}) { - // onProgress is a function, can't be serialized - return JSON.stringify(Object.assign({}, options, {onProgress: null})); + // List of option parameters that won't affect the build result, so they + // can be ignored to calculate the options hash. + const ignoredParams = { + onProgress: null, + excludeSource: null, + sourceMapUrl: null, + }; + + return JSON.stringify(Object.assign({}, options, ignoredParams)); } /**