Polyfill global.Buffer when importing the crypto stub.

This commit is contained in:
Ben Newman
2017-06-02 16:03:19 -04:00
parent 26035bc15a
commit d2fef404f6
2 changed files with 3 additions and 1 deletions

View File

@@ -5,7 +5,7 @@
"cluster": null,
"console": "console-browserify",
"constants": "constants-browserify",
"crypto": "crypto-browserify",
"crypto": "../wrappers/crypto.js",
"core-util-is": null,
"dgram": null,
"dns": null,

2
wrappers/crypto.js Normal file
View File

@@ -0,0 +1,2 @@
global.Buffer = global.Buffer || require("buffer").Buffer;
module.exports = require("crypto-browserify");