Skip to content

Commit a6da773

Browse files
a7medevHeshamMegid
authored andcommitted
chore: extend default metro config (#1039)
1 parent d7d5a02 commit a6da773

File tree

3 files changed

+395
-1
lines changed

3 files changed

+395
-1
lines changed

examples/default/metro.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const path = require('path');
22
const escape = require('escape-string-regexp');
3+
const { mergeConfig, getDefaultConfig } = require('@react-native/metro-config');
34
const exclusionList = require('metro-config/src/defaults/exclusionList');
45

56
const root = path.resolve(__dirname, '../..');
@@ -15,7 +16,7 @@ const modules = [
1516
'promise',
1617
];
1718

18-
module.exports = {
19+
const config = {
1920
watchFolders: [root],
2021
transformer: {
2122
getTransformOptions: async () => ({
@@ -35,3 +36,5 @@ module.exports = {
3536
}, {}),
3637
},
3738
};
39+
40+
module.exports = mergeConfig(getDefaultConfig(__dirname), config);

examples/default/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"@babel/core": "^7.20.0",
2626
"@babel/preset-env": "^7.20.0",
2727
"@babel/runtime": "^7.20.0",
28+
"@react-native/metro-config": "^0.73.1",
2829
"@types/jest": "^29.2.1",
2930
"@types/react": "^18.0.24",
3031
"@types/react-native-vector-icons": "^6.4.13",

0 commit comments

Comments
 (0)