Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between "react-native bundle" and "react-native unbundle"?

Tags:

react-native

What is the purpose of "unbundle"?

I find two different options to create React Native offline bundle. There is not much description about this option.

bundle [options] builds the javascript bundle for offline use

unbundle [options] builds javascript as "unbundle" for offline use

I usually create a react-native bundle using "react-native bundle" command like:

react-native bundle --platform ios --dev false --entry-file index.ios.js --bundle-output iOS/main.jsbundle

Even if I create a bundle using command below, I can run it as same as previous one:

react-native unbundle --platform ios --dev false --entry-file index.ios.js --bundle-output iOS/main.jsbundle

Size of output file is almost same, definitely contents of ouptut file is different. I thought 'unbundle' option is to create multiple separated bundles to share common part of bundle.

Does anyone know exactly what 'unbundle' is?

like image 636
ccoroom Avatar asked Jun 24 '26 17:06

ccoroom


1 Answers

android unbundle means create separated files. ios unbundle means create a big file contains mapping table and codes. It is slow for iOS to load multiple small files.

like image 158
wesleydotyang Avatar answered Jun 28 '26 10:06

wesleydotyang



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!