Skip to content

Commit

Permalink
combine wasm + js files
Browse files Browse the repository at this point in the history
  • Loading branch information
woodser committed Sep 1, 2024
1 parent ad415cd commit 313cc5c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ EMCC_LINKER_FLAGS_BASE
-s NODEJS_CATCH_EXIT=0 \
-s RESERVED_FUNCTION_POINTERS=5 \
-s EXPORTED_RUNTIME_METHODS='[\"UTF8ToString\",\"stringToUTF8\",\"lengthBytesUTF8\",\"intArrayToString\",\"getTempRet0\",\"addFunction\"]' \
-s WASM=1 \
-s SINGLE_FILE \
-s ALLOW_MEMORY_GROWTH=1 \
-s WASM_BIGINT=1 \
"
Expand Down
12 changes: 1 addition & 11 deletions bin/build_wasm_emscripten.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,15 @@ cd build || exit 1
emcmake cmake .. || exit 1
emmake cmake --build . -j$HOST_NCORES || exit 1

# move available wasm files to ./dist
# move wasm files to ./dist
cd ..
mkdir -p ./dist || exit 1
[ -f ./build/monero_wallet_keys.js ] \
&& {
mv ./build/monero_wallet_keys.js ./dist/
}

[ -f ./build/monero_wallet_keys.wasm ] \
&& {
mv ./build/monero_wallet_keys.wasm ./dist/
}

[ -f ./build/monero_wallet_full.js ] \
&& {
mv ./build/monero_wallet_full.js ./dist/
}

[ -f ./build/monero_wallet_full.wasm ] \
&& {
mv ./build/monero_wallet_full.wasm ./dist/
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"build_web_tests": "webpack --config ./webpack.tests.js",
"test": "npm run build_commonjs && node --enable-source-maps --no-experimental-fetch node_modules/mocha/bin/_mocha --require @babel/register \"dist/src/test/TestAll\" --timeout 900000000 --exit",
"typedoc": "typedoc ./index.ts --out ./docs/typedocs --excludePrivate --disableSources",
"build_commonjs": "babel ./src --extensions \".js,.ts\" --out-dir ./dist/src && babel ./index.ts --extensions \".ts\" --out-dir ./dist && shx mkdir -p dist/dist && shx cp dist/monero_wallet_full.js dist/monero_wallet_keys.js dist/dist && shx cp dist/*.js.map dist/dist && shx cp dist/*.wasm dist/dist",
"build_commonjs": "babel ./src --extensions \".js,.ts\" --out-dir ./dist/src && babel ./index.ts --extensions \".ts\" --out-dir ./dist && shx mkdir -p dist/dist && shx cp dist/monero_wallet_full.js dist/monero_wallet_keys.js dist/dist && shx cp dist/*.js.map dist/dist",
"check_babel_version": "babel -V"
},
"build": {
Expand Down

0 comments on commit 313cc5c

Please sign in to comment.