Skip to content

Commit

Permalink
more metro fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
krizzu committed Jan 27, 2025
1 parent 7e5bd94 commit 0cc34d5
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 7 deletions.
1 change: 1 addition & 0 deletions packages/default-storage/example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ buck-out/

# Bundle artifact
*.jsbundle
*.bundle

# CocoaPods
/ios/Pods/
Expand Down
10 changes: 7 additions & 3 deletions packages/default-storage/example/metro.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
const { makeMetroConfig } = require("@rnx-kit/metro-config");
const path = require("node:path");

module.exports = makeMetroConfig({
projectRoot: path.join(__dirname, "example"),
watchFolders: [__dirname],
projectRoot: __dirname,
watchFolders: [__dirname, path.resolve(__dirname, "..")],
resolver: {
extraNodeModules: {
"@react-native-async-storage/async-storage": __dirname,
"@react-native-async-storage/async-storage": path.resolve(
__dirname,
".."
),
},
},
transformer: {
Expand Down
2 changes: 1 addition & 1 deletion packages/default-storage/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"hoistingLimits": "workspaces"
},
"dependencies": {
"@rnx-kit/metro-config": "^2.0.1",
"react": "18.3.1",
"react-native": "0.76.1"
},
Expand All @@ -35,7 +36,6 @@
"@react-native-community/cli-platform-android": "^15.0.0",
"@react-native-community/cli-platform-ios": "^15.0.0",
"@react-native/babel-preset": "^0.76.0",
"@react-native/metro-config": "^0.76.0",
"react-native-builder-bob": "^0.33.3",
"react-native-macos": "^0.76.0",
"react-native-test-app": "^4.0.3",
Expand Down
10 changes: 7 additions & 3 deletions packages/sqlite-storage/example/metro.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
const { makeMetroConfig } = require("@rnx-kit/metro-config");
const path = require("node:path");

module.exports = makeMetroConfig({
projectRoot: path.join(__dirname, "example"),
watchFolders: [__dirname],
projectRoot: __dirname,
watchFolders: [__dirname, path.resolve(__dirname, "..")],
resolver: {
extraNodeModules: {
"@react-native-async-storage/sqlite-storage": __dirname,
"@react-native-async-storage/sqlite-storage": path.resolve(
__dirname,
".."
),
},
},
transformer: {
Expand Down
19 changes: 19 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4752,6 +4752,24 @@ __metadata:
languageName: node
linkType: hard

"@rnx-kit/metro-config@npm:^2.0.1":
version: 2.0.1
resolution: "@rnx-kit/metro-config@npm:2.0.1"
dependencies:
"@rnx-kit/tools-node": "npm:^3.0.0"
"@rnx-kit/tools-react-native": "npm:^2.0.0"
"@rnx-kit/tools-workspaces": "npm:^0.2.0"
peerDependencies:
"@react-native/metro-config": "*"
react: "*"
react-native: "*"
peerDependenciesMeta:
"@react-native/metro-config":
optional: true
checksum: 10c0/fb90bdcec980595898a7c675dd83c81a91f08bdfea06ed1e9f8583fa69b719b089527bc0595406d65e3c70fd46c5acfbafd373183cd91e0c68cb7c81427b8d11
languageName: node
linkType: hard

"@rnx-kit/react-native-host@npm:^0.5.0":
version: 0.5.0
resolution: "@rnx-kit/react-native-host@npm:0.5.0"
Expand Down Expand Up @@ -10810,6 +10828,7 @@ __metadata:
"@react-native-community/cli-platform-ios": "npm:^15.0.0"
"@react-native/babel-preset": "npm:^0.76.0"
"@react-native/metro-config": "npm:^0.76.0"
"@rnx-kit/metro-config": "npm:^2.0.1"
react: "npm:18.3.1"
react-native: "npm:0.76.1"
react-native-builder-bob: "npm:^0.33.3"
Expand Down

0 comments on commit 0cc34d5

Please sign in to comment.