From 456829be16d7d4656f487eeba43198dd338afa39 Mon Sep 17 00:00:00 2001 From: David Baldassari Date: Wed, 7 Aug 2024 16:35:22 -0500 Subject: [PATCH] fix: web:build command not longer throw errors --- example/metro.config.web.cjs | 2 ++ example/package.json | 3 ++- yarn.lock | 12 ++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/example/metro.config.web.cjs b/example/metro.config.web.cjs index 90dfb85..0f459fe 100644 --- a/example/metro.config.web.cjs +++ b/example/metro.config.web.cjs @@ -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 @@ -15,6 +16,7 @@ const config = makeMetroConfig({ extraNodeModules: { "react-native": reactNativeWebPath, "react-native-web": reactNativeWebPath, + "react-native-svg": reactNativeSvgPath, }, platforms: ["ios", "android", "native"], resolveRequest: MetroSymlinksResolver(), diff --git a/example/package.json b/example/package.json index 228e27a..1eb4ff0 100644 --- a/example/package.json +++ b/example/package.json @@ -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": { @@ -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" }, diff --git a/yarn.lock b/yarn.lock index 8f24e24..bcc7b1d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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" @@ -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"