Skip to content

Commit 7e4de9d

Browse files
committed
feat: add @callstack/out-of-tree-platforms to metro config
1 parent 1e6962b commit 7e4de9d

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');
2+
const {getPlatformResolver} = require('@callstack/out-of-tree-platforms');
23

34
/**
45
* Metro configuration
56
* https://facebook.github.io/metro/docs/configuration
67
*
78
* @type {import('metro-config').MetroConfig}
89
*/
9-
const config = {};
10+
11+
12+
const config = {
13+
resolver: {
14+
resolveRequest: getPlatformResolver({
15+
platformNameMap: [{visionos: '@callstack/react-native-visionos'}],
16+
}),
17+
},
18+
};
1019

1120
module.exports = mergeConfig(getDefaultConfig(__dirname), config);

packages/react-native/template/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"@react-native/eslint-config": "^0.74.0",
2323
"@react-native/metro-config": "^0.74.0",
2424
"@react-native/typescript-config": "^0.74.0",
25+
"@callstack/out-of-tree-platforms": "^0.74.0",
2526
"@types/react": "^18.2.6",
2627
"@types/react-test-renderer": "^18.0.0",
2728
"babel-jest": "^29.6.3",

0 commit comments

Comments
 (0)