diff --git a/packages/uniwind/src/metro/resolvers.ts b/packages/uniwind/src/metro/resolvers.ts index 730fa2ef..077d33d9 100644 --- a/packages/uniwind/src/metro/resolvers.ts +++ b/packages/uniwind/src/metro/resolvers.ts @@ -47,11 +47,9 @@ export const nativeResolver = ({ }: ResolverConfig) => { const resolution = resolver(context, moduleName, platform) const isInternal = isFromThisModule(context.originModulePath) - const isReactNativeIndex = context.originModulePath.endsWith( - `react-native${sep}index.js`, - ) + const isFromReactNative = context.originModulePath.includes(`${sep}react-native${sep}`) - if (isInternal || resolution.type !== 'sourceFile' || isReactNativeIndex) { + if (isInternal || resolution.type !== 'sourceFile' || isFromReactNative) { return resolution }