mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-05-09 03:38:01 +00:00
Add Wasm compression
This commit is contained in:
@@ -35,7 +35,12 @@ RESOLC_JS_PACKED=$(RESOLC_WASM_TARGET_DIR)/resolc_packed.js
|
||||
|
||||
install-wasm: install-npm
|
||||
cargo build --target wasm32-unknown-emscripten -p revive-solidity --release --no-default-features
|
||||
@echo "let moduleArgs = { wasmBinary: readBinary(\"data:application/octet-stream;base64,$$(base64 -w 0 $(RESOLC_WASM))\") };" > $(RESOLC_JS_PACKED)
|
||||
@echo "let moduleArgs = { wasmBinary: (function(source, uncompressedSize) {" > $(RESOLC_JS_PACKED)
|
||||
@cat js/utils/mini-lz4.js >> $(RESOLC_JS_PACKED)
|
||||
@cat js/utils/base64DecToArr.js >> $(RESOLC_JS_PACKED)
|
||||
@echo "return uncompress(base64DecToArr(source), uncompressedSize);})(" >> $(RESOLC_JS_PACKED)
|
||||
@echo "\"$$(lz4c --no-frame-crc --best --favor-decSpeed "${RESOLC_WASM}" - | tail -c +8 | base64 -w 0 )\"," >> $(RESOLC_JS_PACKED)
|
||||
@echo "$$(wc -c < $(RESOLC_WASM)))};" >> $(RESOLC_JS_PACKED)
|
||||
@cat $(RESOLC_JS) >> $(RESOLC_JS_PACKED)
|
||||
@echo "createRevive = createRevive.bind(null, moduleArgs);" >> $(RESOLC_JS_PACKED)
|
||||
@echo "Combined script written to $(RESOLC_JS_PACKED)"
|
||||
|
||||
Reference in New Issue
Block a user