'Bundling core Node module with Metro

I'm trying to deploy a react-native app to android, the app uses the Web3 library which at a few points uses core node modules (for example a module called 'crypto'), is there any way to bundle the core node modules as if they were a simple npm module?

Ideally I don't want to manually include the core modules since if they were to be updated I'd have to do it manually, and I do not want to create a fork of the Web3 library which uses npm modules instead of the core modules.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source