node-libs-react-native icon indicating copy to clipboard operation
node-libs-react-native copied to clipboard

App size is large

Open rueiwoqp opened this issue 4 years ago • 3 comments

My app, though very small in terms of my code, is 200MB which is mostly due to node-libs-react-native. Is there any way to reduce the size? Are all libraries required or would is it possible to disable some of them?

rueiwoqp avatar Dec 28 '20 22:12 rueiwoqp

I haven't personally run into this problem, can you provide more information? Are you seeing this as your node_module size, your app bundle size, or your overall app binary size? Are you able to tell which dependency is causing the bloat?

parshap avatar Dec 28 '20 23:12 parshap

It is the .ipa size. I tried using https://github.com/IjzerenHein/react-native-bundle-visualizer but I get an error with node-libs-react-native when I run the command:

npx react-native-bundle-visualizer --expo managed

I get:

Error: Unable to resolve module `stream` from `node_modules/ccxt/js/static_dependencies/node-fetch/index.js`: stream could not be found within the project.

However, the visualizer used to work and it showed node-libs-react-native as a large dependency.

rueiwoqp avatar Dec 29 '20 01:12 rueiwoqp

I apologize as I'm not currently actively developing in React Native and can't investigate this further right now. The bloat is indeed coming from node-libs-react-native, it's most likely one of the native dependencies. In theory you should to identify and remove that dependency. You can also try copying the contents of index.js from this repo to your app and include only the modules that you need.

parshap avatar Dec 29 '20 01:12 parshap