diff --git a/build/files.js b/build/files.js index 80a69533c0..6a5a34299a 100644 --- a/build/files.js +++ b/build/files.js @@ -179,7 +179,7 @@ const headRegexp = /(^module.exports = \w+;?)/m /(?:var|const) Buffer = require\('safe-buffer'\)\.Buffer;/ , ` const Buffer = require('safe-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); }