Skip to content

Commit fe42955

Browse files
committed
now bundling successfully
1 parent a7ab2a8 commit fe42955

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed
Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,28 @@
1-
const path = require('path');
2-
const { getDefaultConfig } = require('@react-native/metro-config');
3-
const { withMetroConfig } = require('react-native-monorepo-config');
4-
5-
const root = path.resolve(__dirname, '..');
1+
const path = require('node:path');
2+
const { makeMetroConfig } = require('@rnx-kit/metro-config');
63

74
/**
85
* Metro configuration
96
* https://facebook.github.io/metro/docs/configuration
107
*
118
* @type {import('metro-config').MetroConfig}
129
*/
13-
const config = withMetroConfig(getDefaultConfig(__dirname), {
14-
root,
15-
dirname: __dirname,
10+
const config = makeMetroConfig({
11+
transformer: {
12+
getTransformOptions: () => ({
13+
transform: {
14+
experimentalImportSupport: false,
15+
inlineRequires: false,
16+
},
17+
}),
18+
},
1619
});
20+
config.watchFolders = [
21+
...new Set([
22+
...config.watchFolders,
23+
// Watch the parent directory, for the "nativescript-jsi" package.
24+
path.resolve('..'),
25+
]),
26+
];
1727

1828
module.exports = config;

packages/jsi/example/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"@react-native/babel-preset": "0.83.0",
2424
"@react-native/metro-config": "0.83.0",
2525
"@react-native/typescript-config": "0.83.0",
26+
"@rnx-kit/metro-config": "^2.2.4",
2627
"@types/react": "^19.2.0",
2728
"react-native-builder-bob": "^0.40.18",
2829
"react-native-monorepo-config": "^0.3.3"

0 commit comments

Comments
 (0)