repack icon indicating copy to clipboard operation
repack copied to clipboard

build two miniapps in a apk

Open andreszuluaga-wolox opened this issue 2 years ago • 3 comments

Ask your Question

I need build two or more mini apps in a apk, and acces chunk local

andreszuluaga-wolox avatar Jan 21 '22 16:01 andreszuluaga-wolox

Can you provide more information? Some example or repro project?

zamotany avatar Jan 26 '22 09:01 zamotany

I published an issues with all the information of my projects. Issue #151 . I need to build both projects in one apk/ipa

andreszuluaga-wolox avatar Jan 26 '22 11:01 andreszuluaga-wolox

The problem in #151 is likely caused by duplicated react-native-reanimated dependency - you need to somehow (depends on your setup) ensure there's only single react-native-reanimated. If you're using Module Federation, react-native-reanimated must be added to shared in every container: https://github.com/zamotany/module-federation-repack/blob/main/host/webpack.config.js#L313-L318

For reference: https://github.com/zamotany/module-federation-repack/pull/4

If you need to have 2 or more miniapps, you need to alter the XCode/Gradle build step to copy additional miniapps or you could create a Webpack plugin or use https://github.com/webpack-contrib/copy-webpack-plugin to copy miniapps as part of the host Webpack compilation.

In Re.Pack 2, the easiest way to do so is to use process.env[CLI_OPTIONS_ENV_KEY] and take bundleOutput, similarly to have OutputPlugin does it: https://github.com/callstack/repack/blob/2.x/packages/repack/src/webpack/plugins/OutputPlugin.ts#L57-L77

zamotany avatar Jul 11 '22 13:07 zamotany

Closing as the issue became stale, and answer was provided.

jbroma avatar Dec 18 '23 10:12 jbroma