Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: web:build command not longer throw errors #156

Merged
merged 2 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions example/metro.config.web.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const { makeMetroConfig } = require("@rnx-kit/metro-config");
const MetroSymlinksResolver = require("@rnx-kit/metro-resolver-symlinks");

const reactNativeWebPath = require.resolve("react-native-web");
const reactNativeSvgPath = require.resolve("react-native-svg-web");

/**
* Metro configuration
Expand All @@ -14,6 +15,7 @@ const config = makeMetroConfig({
resolver: {
extraNodeModules: {
"react-native": reactNativeWebPath,
"react-native-svg": reactNativeSvgPath,
"react-native-web": reactNativeWebPath,
},
platforms: ["ios", "android", "native"],
Expand Down
3 changes: 2 additions & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"ios": "react-native run-ios",
"start": "react-native rnx-start",
"start:reset": "yarn start --reset-cache",
"web:build": "react-native bundle --config metro.config.web.js --dev false --entry-file index.js --bundle-output dist/index.bundle.js",
"web:build": "react-native bundle --config metro.config.web.cjs --dev false --entry-file index.js --bundle-output dist/index.bundle.js",
"web:start": "yarn serve"
},
"installConfig": {
Expand All @@ -28,6 +28,7 @@
"react-native": "0.74.3",
"react-native-spotlight-tour": "workspace:^",
"react-native-svg": "^15.4.0",
"react-native-svg-web": "^1.0.9",
"react-native-web": "^0.19.12",
"styled-components": "^6.1.11"
},
Expand Down
12 changes: 12 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6404,6 +6404,7 @@ __metadata:
react-native: "npm:0.74.3"
react-native-spotlight-tour: "workspace:^"
react-native-svg: "npm:^15.4.0"
react-native-svg-web: "npm:^1.0.9"
react-native-web: "npm:^0.19.12"
serve: "npm:^14.2.3"
styled-components: "npm:^6.1.11"
Expand Down Expand Up @@ -10957,6 +10958,17 @@ __metadata:
languageName: unknown
linkType: soft

"react-native-svg-web@npm:^1.0.9":
version: 1.0.9
resolution: "react-native-svg-web@npm:1.0.9"
peerDependencies:
prop-types: "*"
react: "*"
react-native-web: ">= 0.10.1"
checksum: 10/fb217afb275a3e06f8c4e5e79d6099cdabb16fa294cd7611bc4cdbbc3ffcaa6c848cdb23dbe7673d11ab57a635c82a0f752a627fbc183f4884c255346f1c53e5
languageName: node
linkType: hard

"react-native-svg@npm:^15.4.0":
version: 15.4.0
resolution: "react-native-svg@npm:15.4.0"
Expand Down