diff options
author | dan <dan.abramov@gmail.com> | 2024-11-01 03:42:38 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-01 03:42:38 +0000 |
commit | 01c9ac0e13e959bae9ab221cd0a724a70c222772 (patch) | |
tree | 7b80d2cdde328753276a171adff0f06f79f83ef5 /metro.config.js | |
parent | 4c31403330abeba2c0b9e910239c18672e5fcb0d (diff) | |
download | voidsky-01c9ac0e13e959bae9ab221cd0a724a70c222772.tar.zst |
Implement posting threads (#6049)
* Implement posting a thread Co-authored-by: Dan Abramov <dan.abramov@gmail.com> * Fix native build * Remove dependency on web crypto API * Fix unrelated TS error (wtf) --------- Co-authored-by: Mary <148872143+mary-ext@users.noreply.github.com>
Diffstat (limited to 'metro.config.js')
-rw-r--r-- | metro.config.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/metro.config.js b/metro.config.js index a49d95f9a..ad0a54fc8 100644 --- a/metro.config.js +++ b/metro.config.js @@ -6,6 +6,32 @@ cfg.resolver.sourceExts = process.env.RN_SRC_EXT ? process.env.RN_SRC_EXT.split(',').concat(cfg.resolver.sourceExts) : cfg.resolver.sourceExts +if (cfg.resolver.resolveRequest) { + throw Error('Update this override because it is conflicting now.') +} +cfg.resolver.resolveRequest = (context, moduleName, platform) => { + // HACK: manually resolve a few packages that use `exports` in `package.json`. + // A proper solution is to enable `unstable_enablePackageExports` but this needs careful testing. + if (moduleName.startsWith('multiformats/hashes/hasher')) { + return context.resolveRequest( + context, + 'multiformats/dist/src/hashes/hasher', + platform, + ) + } + if (moduleName.startsWith('multiformats/cid')) { + return context.resolveRequest( + context, + 'multiformats/dist/src/cid', + platform, + ) + } + if (moduleName === '@ipld/dag-cbor') { + return context.resolveRequest(context, '@ipld/dag-cbor/src', platform) + } + return context.resolveRequest(context, moduleName, platform) +} + cfg.transformer.getTransformOptions = async () => ({ transform: { experimentalImportSupport: true, |