From e33f0bcf8116dfca72ee2c1c53b7585117752881 Mon Sep 17 00:00:00 2001 From: Arik Sosman Date: Tue, 12 Jan 2016 13:35:12 -0800 Subject: [PATCH] now using some explicit req --- index.js | 3 ++- package.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index a602e76..7019860 100644 --- a/index.js +++ b/index.js @@ -5,7 +5,8 @@ if (typeof Buffer === 'undefined') { var sjcl = require('sjcl'); var sjclRandom = new sjcl.prng(10); -var RNRandomBytes = require('react-native').NativeModules.RNRandomBytes; +var explicitReq = require; +var RNRandomBytes = explicitReq('react-native').NativeModules.RNRandomBytes; module.exports.randomBytes = function(length, cb) { diff --git a/package.json b/package.json index 1606dc1..dc53c38 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "babelify": "mkdir -p browser && ./node_modules/.bin/browserify --exclude react-native -t [ babelify --presets [ react es2015 ] ] ./index.js | sed -e 's/require/bitgoReq/g' > ./browser/react_index.js" + "babelify": "mkdir -p browser && ./node_modules/.bin/browserify --exclude react-native -t [ babelify --presets [ react es2015 ] ] ./index.js | sed -e 's/require/bitgoReq/g' | sed -e 's/explicitReq = bitgoReq/explicitReq = require/g' > ./browser/react_index.js" }, "keywords": [ "react-component",