metro package exports is enabled by default
This commit is contained in:
@@ -17,25 +17,6 @@ if (process.env.BSKY_PROFILE) {
|
|||||||
cfg.resolver.assetExts = [...cfg.resolver.assetExts, 'woff2']
|
cfg.resolver.assetExts = [...cfg.resolver.assetExts, 'woff2']
|
||||||
|
|
||||||
cfg.resolver.resolveRequest = (context, moduleName, platform) => {
|
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)
|
|
||||||
}
|
|
||||||
if (process.env.BSKY_PROFILE) {
|
if (process.env.BSKY_PROFILE) {
|
||||||
if (moduleName.endsWith('ReactNativeRenderer-prod')) {
|
if (moduleName.endsWith('ReactNativeRenderer-prod')) {
|
||||||
return context.resolveRequest(
|
return context.resolveRequest(
|
||||||
|
|||||||
Reference in New Issue
Block a user