Skip to content

Commit

Permalink
fix: handle more out of tree plaforms
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed Jul 4, 2024
1 parent b38cae9 commit 72bb72d
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions packages/react-native-builder-bob/src/babel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,23 @@ const isModule = (filename: string, ext: string): boolean => {

// Metro won't resolve these extensions if explicit extension is provided
// So we can't add extension to these files
const additional = ['native', 'android', 'ios', 'web'];
const platforms = [
'native',
'android',
'ios',
'windows',
'macos',
'visionos',
'web',
'tv',
'android.tv',
'ios.tv',
];

return exts.some(
(ext) =>
isFile(`${filename}.${ext}`) &&
additional.every((add) => !isFile(`${filename}.${add}.${ext}`))
platforms.every((platform) => !isFile(`${filename}.${platform}.${ext}`))
);
};

Expand Down

0 comments on commit 72bb72d

Please sign in to comment.