diff --git a/package.json b/package.json index 0bd36c1..382a2b4 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ } }, "./components/*": { - "source": "./src/components/*.ts", + "source": "./src/components/*.tsx", "react-native": "./src/components/*.tsx", "import": { "types": "./dist/typescript/module/src/components/*.d.ts", diff --git a/src/metro/resolver.ts b/src/metro/resolver.ts index b5c613a..05c6dac 100644 --- a/src/metro/resolver.ts +++ b/src/metro/resolver.ts @@ -26,7 +26,7 @@ export function nativeResolver( const resolution = resolver(context, moduleName, platform); const isInternal = isFromThisModule(context.originModulePath); const isReactNativeIndex = context.originModulePath.endsWith( - `react-native${sep}index.js`, + `${sep}react-native${sep}index.js`, ); if (isInternal || resolution.type !== "sourceFile" || isReactNativeIndex) { @@ -73,7 +73,9 @@ export function webResolver( // Only operate on source files resolution.type !== "sourceFile" || // Skip anything that isn't importing from `react-native-web` - !resolution.filePath.includes(`${sep}react-native-web${sep}`) + !resolution.filePath.includes(`${sep}react-native-web${sep}`) || + // Skip internal react-native-web files + resolution.filePath.includes(`${sep}react-native-web${sep}dist${sep}vendor`) ) { return resolution; } @@ -83,7 +85,12 @@ export function webResolver( const isIndex = segments.at(-1)?.startsWith("index."); const module = segments.at(-2); - if (!isIndex || !module || !allowedModules.has(module)) { + if ( + !isIndex || + !module || + !allowedModules.has(module) || + module === "VirtualizedList" + ) { return resolution; }