tradle / rn-nodeify

hack to allow react-native projects to use node core modules, and npm modules that use them
MIT License
614 stars 114 forks source link

prevent hacking specific module #131

Open nriccar opened 1 year ago

nriccar commented 1 year ago

hey hey! I'm using rn-nodify but I wan't to use https://github.com/margelo/react-native-quick-crypto for crypto module instead of react-native-crypto... any way of overriding this?

I tried this in shim.js

const quickcrypto = require('react-native-quick-crypto').default
global.crypto = quickcrypto

with no luck. I also tried overriding browser and react-native fields on package json from

"crypto": "react-native-crypto"

to

"crypto": "react-native-quick-crypto"

but it didn't work neither. any ideas? thanks for reading!

edit: also, when injecting shims I'm experiencing a freeze of ~4 secs.. Is there any way of improving this?