You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- After the environment is configured, open its details page in the Zephyr dashboard for each platform. Zephyr will display the hosted URLs for the HostApp and each miniapp.
631
+
```js title="MiniApp/rspack.config.mjs"{9,19,68}
632
+
importpathfrom'node:path';
633
+
import {fileURLToPath} from'node:url';
634
+
import*asRepackfrom'@callstack/repack';
635
+
import {withZephyr} from'zephyr-repack-plugin';
636
+
637
+
const__filename=fileURLToPath(import.meta.url);
638
+
const__dirname=path.dirname(__filename);
639
+
640
+
constUSE_ZEPHYR=Boolean(process.env.ZC);
641
+
constSTANDALONE=Boolean(process.env.STANDALONE);
642
+
643
+
/**
644
+
* Rspack configuration enhanced with Re.Pack defaults for React Native.
645
+
*
646
+
* Learn about Rspack configuration: https://rspack.dev/config/
647
+
* Learn about Re.Pack configuration: https://re-pack.dev/docs/guides/configuration
2. Bundle HostApp and MiniApps, and upload to Zephyr Cloud:
565
726
566
-
- In your HostApp project directory, open the HostApp/rspack.config.mjsfile. Locate the remotes object, which defines how to load each miniapp remotely.
727
+
- Bundle the MiniApp:
567
728
568
-
- Replace each remote’s localhost URLwith the Zephyr Cloud URL. For example:
- In the example above, replace MiniApp with your actual miniapp name (used both as the object key and inside the URL path), and replace yourusername with your Zephyr username/organization. The ${platform} placeholder will be replaced by Rspack with android or ios at build time. Ensure the URL has a trailing slash before ${platform} as shown.
739
+
- Command run with `ZC=1` will upload the bundles to Zephyr Cloud.
577
740
578
-
- If you have multiple miniapps, add each one to the remotes object in the same way, using its own name and Zephyr URL. For example:
- For Android, you can use the following command from the HostApp android directory:
587
745
588
-
4. Build and run the HostApp in release mode:
746
+
```bash
747
+
ZC=1 ./gradlew assembleRelease
748
+
```
589
749
590
-
- With the configuration updated, build and launch the HostApp using your normal release process.
750
+
{/* TODO: set ZC for iOS */}
751
+
{/* - For iOS, you can use the following command: */}
591
752
592
753
- The HostApp will now load each miniapp bundle from the specified Zephyr Cloud URLs instead of localhost. Verify that the app launches correctly and that each miniapp is fetched successfully from the remote URL.
0 commit comments