Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: set tsconfig moduleResolution to Node16 #27

Merged
merged 13 commits into from
Feb 12, 2024
1 change: 1 addition & 0 deletions esm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"node:crypto": false
},
"node": {
"./crypto.js": "./esm/cryptoNode.js",
"./crypto": "./esm/cryptoNode.js"
}
}
3 changes: 3 additions & 0 deletions src/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "module"
}
3 changes: 3 additions & 0 deletions src/webcrypto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
// 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.
//
// 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';
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.esm.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"paths": {
"@noble/ciphers/crypto": ["src/crypto"]
},
"module": "es2020",
"module": "Node16",
"outDir": "esm",
"moduleResolution": "bundler"
"moduleResolution": "Node16"
},
"include": ["src"],
"exclude": ["node_modules", "lib"]
Expand Down
Loading