diff --git a/src/webcrypto.ts b/src/webcrypto.ts index db85c53..001f7c5 100644 --- a/src/webcrypto.ts +++ b/src/webcrypto.ts @@ -4,7 +4,10 @@ // from `crypto` to `cryptoNode`, which imports native module. // Makes the utils un-importable in browsers without a bundler. // Once node.js 18 is deprecated, we can just drop the import. -import { randomBytes, getWebcryptoSubtle } from './crypto.js'; +// +// Use full path so that Node.js can rewrite it to `cryptoNode.js`. +// @ts-ignore: `tsc` doesn't understand `@noble/ciphers/crypto` is a valid import. +import { randomBytes, getWebcryptoSubtle } from '@noble/ciphers/crypto'; import { Cipher, concatBytes } from './utils.js'; import { number } from './_assert.js'; import { AsyncCipher } from './utils.js';