Skip to content

Commit

Permalink
fix: web:build command not longer throw errors
Browse files Browse the repository at this point in the history
  • Loading branch information
hdbv95 committed Aug 7, 2024
1 parent 9115aa8 commit 456829b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
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 @@ -15,6 +16,7 @@ const config = makeMetroConfig({
extraNodeModules: {
"react-native": reactNativeWebPath,
"react-native-web": reactNativeWebPath,
"react-native-svg": reactNativeSvgPath,

Check failure on line 19 in example/metro.config.web.cjs

View workflow job for this annotation

GitHub Actions / build (18)

Expected object keys to be in ascending order. 'react-native-svg' should be before 'react-native-web'

Check failure on line 19 in example/metro.config.web.cjs

View workflow job for this annotation

GitHub Actions / build (19)

Expected object keys to be in ascending order. 'react-native-svg' should be before 'react-native-web'

Check failure on line 19 in example/metro.config.web.cjs

View workflow job for this annotation

GitHub Actions / build (20)

Expected object keys to be in ascending order. 'react-native-svg' should be before 'react-native-web'

Check failure on line 19 in example/metro.config.web.cjs

View workflow job for this annotation

GitHub Actions / build (21)

Expected object keys to be in ascending order. 'react-native-svg' should be before 'react-native-web'

Check failure on line 19 in example/metro.config.web.cjs

View workflow job for this annotation

GitHub Actions / build (22)

Expected object keys to be in ascending order. 'react-native-svg' should be before 'react-native-web'
},
platforms: ["ios", "android", "native"],
resolveRequest: MetroSymlinksResolver(),
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

0 comments on commit 456829b

Please sign in to comment.