From 798e213fbab3674d86491291d96aaf01f35e8fbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Zakrzewski?= Date: Fri, 7 Apr 2023 14:33:26 +0200 Subject: [PATCH] chore(TesterApp): Improve remote assets and bundles serving for TesterApp --- .changeset/famous-clouds-sparkle.md | 5 +++++ packages/TesterApp/index.js | 2 +- packages/TesterApp/package.json | 6 +++--- packages/TesterApp/webpack.config.mjs | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 .changeset/famous-clouds-sparkle.md diff --git a/.changeset/famous-clouds-sparkle.md b/.changeset/famous-clouds-sparkle.md new file mode 100644 index 000000000..1b3345ae8 --- /dev/null +++ b/.changeset/famous-clouds-sparkle.md @@ -0,0 +1,5 @@ +--- +"testerapp": patch +--- + +Improve the way remote assets and bundle are served for Release builds of the TesterApp diff --git a/packages/TesterApp/index.js b/packages/TesterApp/index.js index cad03af2a..20961e0ac 100644 --- a/packages/TesterApp/index.js +++ b/packages/TesterApp/index.js @@ -21,7 +21,7 @@ ScriptManager.shared.addResolver(async (scriptId, _caller) => { } return { - url: Script.getRemoteURL(`http://localhost:5000/${scriptId}`), + url: Script.getRemoteURL(`http://localhost:9999/${scriptId}`), }; }); diff --git a/packages/TesterApp/package.json b/packages/TesterApp/package.json index cf01a7a1f..518bcff11 100644 --- a/packages/TesterApp/package.json +++ b/packages/TesterApp/package.json @@ -9,10 +9,10 @@ "android": "react-native run-android", "ios": "react-native run-ios", "start": "react-native webpack-start", - "bundle": "react-native webpack-bundle --platform ios --entry-file index.js --dev=false", - "webpack": "webpack -c webpack.config.js --env platform=ios --env mode=production", + "bundle": "react-native webpack-bundle --platform android --entry-file index.js --dev=false", + "webpack": "webpack -c webpack.config.js --env platform=android --env mode=production", "test": "vitest run", - "serve-remote-assets": "yarn http-server -p 9999 build/output/ios/remote/remote-assets" + "serve-remote-assets": "yarn http-server -p 9999 build/output/android/remote && adb reverse tcp:9999 tcp:9999" }, "dependencies": { "@callstack/repack": "3.2.0-rc.0", diff --git a/packages/TesterApp/webpack.config.mjs b/packages/TesterApp/webpack.config.mjs index e1caa147b..dba5179af 100644 --- a/packages/TesterApp/webpack.config.mjs +++ b/packages/TesterApp/webpack.config.mjs @@ -257,7 +257,7 @@ export default (env) => { scalableAssetExtensions: Repack.SCALABLE_ASSETS, remote: { enabled: true, - publicPath: 'http://localhost:9999', + publicPath: 'http://localhost:9999/remote-assets', }, }, },