diff --git a/build/files.js b/build/files.js index 96d5210947..1494a2a480 100644 --- a/build/files.js +++ b/build/files.js @@ -133,7 +133,7 @@ const headRegexp = /(^module.exports = \w+;?)/m /(?:var|const) (?:{ )Buffer(?: }) = require\('buffer'\)(?:\.Buffer)?;/g , ` const Buffer = require('buffer').Buffer - const OurUint8Array = global.Uint8Array || function () {} + const OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {} function _uint8ArrayToBuffer(chunk) { return Buffer.from(chunk); }