Patch metro config to fix invalid native module urls

This commit is contained in:
Bill Thornton 2024-11-08 13:01:57 -05:00
parent 5ebf8e4d40
commit 18416c21f5

View File

@ -9,4 +9,13 @@ const defaultConfig = getDefaultConfig(__dirname);
defaultConfig.resolver.assetExts.push('staticjs');
defaultConfig.server.rewriteRequestUrl = (url) => {
if (!url.endsWith('.bundle')) {
return url;
}
// https://github.com/facebook/react-native/issues/36794
// JavaScriptCore strips query strings, so try to re-add them with a best guess.
return url + '?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true';
};
module.exports = defaultConfig;