Skip to content

Commit

Permalink
chore: use new metro config
Browse files Browse the repository at this point in the history
  • Loading branch information
trivikr committed Jul 23, 2024
1 parent 2f83b9a commit 64ae2db
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 25 deletions.
31 changes: 7 additions & 24 deletions packages/react-native/metro.config.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,11 @@
const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');

/**
* Metro configuration for React Native
* https://github.com/facebook/react-native
* Metro configuration
* https://facebook.github.io/metro/docs/configuration
*
* @format
* @type {import('metro-config').MetroConfig}
*/
const path = require('path');
const config = {};

module.exports = {
projectRoot: __dirname,
resolver: {
extraNodeModules: new Proxy(
{},
{
get: (target, name) => path.join(__dirname, `node_modules/${name}`),
},
),
},
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false,
},
}),
},
watchFolders: [path.resolve(__dirname, '..', '..')],
};
module.exports = mergeConfig(getDefaultConfig(__dirname), config);
3 changes: 2 additions & 1 deletion packages/react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"devDependencies": {
"@babel/core": "^7.12.9",
"@babel/runtime": "^7.12.5",
"@react-native/babel-preset": "^0.73.21"
"@react-native/babel-preset": "^0.73.21",
"@react-native/metro-config": "^0.73.5"
},
"author": {
"name": "AWS SDK for JavaScript Team",
Expand Down
13 changes: 13 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ __metadata:
"@babel/core": ^7.12.9
"@babel/runtime": ^7.12.5
"@react-native/babel-preset": ^0.73.21
"@react-native/metro-config": ^0.73.5
react: ^18.3.1
react-native: ^0.73.9
react-native-get-random-values: ^1.11.0
Expand Down Expand Up @@ -2427,6 +2428,18 @@ __metadata:
languageName: node
linkType: hard

"@react-native/metro-config@npm:^0.73.5":
version: 0.73.5
resolution: "@react-native/metro-config@npm:0.73.5"
dependencies:
"@react-native/js-polyfills": 0.73.1
"@react-native/metro-babel-transformer": 0.73.15
metro-config: ^0.80.3
metro-runtime: ^0.80.3
checksum: ddf5793664a47bbf16d79d2a4ea7f90cecb01206fbe5fc91aadb5e4169159cf24282ab0116799b9271332b7cb6ce9bc1420a57ad65d9cdfe98ac1e3b9a1f75ae
languageName: node
linkType: hard

"@react-native/normalize-colors@npm:0.73.2, @react-native/normalize-colors@npm:^0.73.0":
version: 0.73.2
resolution: "@react-native/normalize-colors@npm:0.73.2"
Expand Down

0 comments on commit 64ae2db

Please sign in to comment.