fix: alias crypto-browserify to native Web Crypto shim (inherits error)

This commit is contained in:
2026-02-22 19:37:19 +03:00
parent ddcf3eca23
commit e2cfa136f9
2 changed files with 13 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
// Minimal crypto shim that delegates to the browser's native Web Crypto API
// Prevents crypto-browserify (and its inherits dependency) from being bundled
export default globalThis.crypto;
export const webcrypto = globalThis.crypto;
export const randomBytes = (size: number): Uint8Array => {
const bytes = new Uint8Array(size);
globalThis.crypto.getRandomValues(bytes);
return bytes;
};
export const createHash = undefined;
export const createHmac = undefined;