-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
19 lines (14 loc) · 996 Bytes
/
build.sh
File metadata and controls
19 lines (14 loc) · 996 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Install the depencies
npm install --save-dev
# Build and minify
npx esbuild wrapper.js --bundle --outfile=bundle.js --format=esm
npx uglifyjs bundle.js -c -m --ie --v8 --webkit -o bundle.min.js
# Export the Argon2 WASM speedup bundle
cp ./node_modules/argon2-browser/dist/argon2-bundled.min.js ./argon2wasm.js
# Download the Argon2 workers speedup bundle
wget https://raw.githubusercontent.com/Rabbit-Company/Argon2id-JS/4ae1174787b3a8261f17fbfca3db7d6ef8bda665/Argon2idWorker.min.js -q -O argon2wjs-worker.js
wget https://raw.githubusercontent.com/Rabbit-Company/Argon2id-JS/4ae1174787b3a8261f17fbfca3db7d6ef8bda665/Argon2id.min.js -q -O argon2wjs.js
# Patch the Argon2 worker speedup bundle to export Argon2id globally
printf "\n\n/*patch: expose classes to window*/\nwindow.Argon2id=Argon2id;\nwindow.Blake2b=Blake2b;\n" >> argon2wjs.js
# Download the WASMJS+ASMJS AES ponyfill
wget https://github.com/0xEAF/AESPonyfill/releases/download/2.0.2/output.bundle.min.js -q -O aes-ponyfill.js