Merge pull request #547 from thornbill/patch-metro-urls

Patch metro config to fix invalid native module urls
This commit is contained in:
Bill Thornton 2024-11-08 14:01:15 -05:00 committed by GitHub
commit 5161352e73
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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;