Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
"name": "hash-wasm",
"version": "4.12.0",
"description": "Lightning fast hash functions for browsers and Node.js using hand-tuned WebAssembly binaries (MD4, MD5, SHA-1, SHA-2, SHA-3, Keccak, BLAKE2, BLAKE3, PBKDF2, Argon2, bcrypt, scrypt, Adler-32, CRC32, CRC32C, RIPEMD-160, HMAC, xxHash, SM3, Whirlpool)",
"main": "dist/index.umd.js",
"module": "dist/index.esm.js",
"types": "dist/lib/index.d.ts",
"main": "dist/index.cjs",
"exports": {
"require": "dist/index.cjs",
"default": "dist/index.mjs"
},
"types": "dist/index.d.ts",
"scripts": {
"build": "sh -c ./scripts/build.sh",
"lint": "npx @biomejs/biome check lib test",
Expand Down
13 changes: 8 additions & 5 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,16 @@ const MAIN_BUNDLE_CONFIG = {
input: "lib/index.ts",
output: [
{
file: "dist/index.umd.js",
file: "dist/index.cjs",
name: "hashwasm",
format: "umd",
},
{
file: "dist/index.esm.js",
format: "es",
entryFileNames: "[name].mjs",
preserveModules: true,
preserveModulesRoot: "lib",
dir: "dist",
},
],
plugins: [json(), typescript(), license(LICENSE_CONFIG)],
Expand All @@ -69,12 +72,12 @@ const MINIFIED_MAIN_BUNDLE_CONFIG = {
input: "lib/index.ts",
output: [
{
file: "dist/index.umd.min.js",
file: "dist/index.min.cjs",
name: "hashwasm",
format: "umd",
},
{
file: "dist/index.esm.min.js",
file: "dist/index.min.mjs",
format: "es",
},
],
Expand All @@ -90,7 +93,7 @@ const INDIVIDUAL_BUNDLE_CONFIG = (algorithm) => ({
input: `lib/${algorithm}.ts`,
output: [
{
file: `dist/${algorithm}.umd.min.js`,
file: `dist/${algorithm}.min.cjs`,
name: "hashwasm",
format: "umd",
extend: true,
Expand Down
2 changes: 1 addition & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ docker volume rm hash-wasm-volume
# node scripts/optimize
node scripts/make_json
node --max-old-space-size=4096 ./node_modules/rollup/dist/bin/rollup -c
npx tsc ./lib/index --outDir ./dist --downlevelIteration --emitDeclarationOnly --declaration --resolveJsonModule --allowSyntheticDefaultImports
npx tsc ./lib/index --rootDir ./lib --outDir ./dist --downlevelIteration --emitDeclarationOnly --declaration --resolveJsonModule --allowSyntheticDefaultImports

#-s ASSERTIONS=1 \
7 changes: 4 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"compilerOptions": {
"target": "ES6",
"module": "ES6",
"lib": ["es2017", "es7", "es6", "dom"],
"target": "es2017",
"lib": ["es2017", "dom"],
"baseUrl": ".",
"rootDir": "lib",
"strict": false,
"esModuleInterop": true,
"downlevelIteration": true,
Expand All @@ -13,4 +14,4 @@
"include": [
"lib",
]
}
}