Tag: browserify browserify

如何为React Native修补/填充crypto.getRandomValues

我使用ReactNativify将一些为NodeJS创build的包移植到React Native,以将Node API对象依赖项重写为他们的browserify等价物。 其中之一是crypto 。 在transformer.js (或.babelrc )中我有: // The following plugin will rewrite imports. Reimplementations of node // libraries such as `assert`, `buffer`, etc. will be picked up // automatically by the React Native packager. All other built-in node // libraries get rewritten to their browserify counterpart. [require('babel-plugin-rewrite-require'), { aliases: { crypto: 'crypto-browserify', // […]