Skip to content

Commit 72bb72d

Browse files
committed
fix: handle more out of tree plaforms
1 parent b38cae9 commit 72bb72d

File tree

1 file changed

+13
-2
lines changed
  • packages/react-native-builder-bob/src

1 file changed

+13
-2
lines changed

packages/react-native-builder-bob/src/babel.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,23 @@ const isModule = (filename: string, ext: string): boolean => {
3131

3232
// Metro won't resolve these extensions if explicit extension is provided
3333
// So we can't add extension to these files
34-
const additional = ['native', 'android', 'ios', 'web'];
34+
const platforms = [
35+
'native',
36+
'android',
37+
'ios',
38+
'windows',
39+
'macos',
40+
'visionos',
41+
'web',
42+
'tv',
43+
'android.tv',
44+
'ios.tv',
45+
];
3546

3647
return exts.some(
3748
(ext) =>
3849
isFile(`${filename}.${ext}`) &&
39-
additional.every((add) => !isFile(`${filename}.${add}.${ext}`))
50+
platforms.every((platform) => !isFile(`${filename}.${platform}.${ext}`))
4051
);
4152
};
4253

0 commit comments

Comments
 (0)