mirror of https://github.com/vacp2p/zerokit.git
add wasm-strip to reduce size even more (#137)
* added wasm-strip fixed docs * requested change * fix installdeps * fix ubuntu * fix macos --------- Co-authored-by: tyshkor <tyshko1@gmail.com>
This commit is contained in:
parent
2bbb710e83
commit
13a2c61355
9
Makefile
9
Makefile
|
@ -12,6 +12,15 @@ ifdef CI
|
|||
endif
|
||||
|
||||
installdeps: .pre-build
|
||||
ifeq ($(shell uname),Darwin)
|
||||
@brew update
|
||||
@brew install cmake ninja
|
||||
else ifeq ($(shell uname),Linux)
|
||||
@sudo apt-get update
|
||||
@sudo apt-get install -y cmake ninja-build
|
||||
endif
|
||||
@git clone --recursive https://github.com/WebAssembly/wabt.git
|
||||
@cd wabt && mkdir build && cd build && cmake .. -GNinja && ninja && sudo ninja install
|
||||
|
||||
build: .pre-build
|
||||
@cargo make build
|
||||
|
|
|
@ -9,9 +9,14 @@ script = "sed -i.bak 's/rln-wasm/zerokit-rln-wasm/g' pkg/package.json && rm pkg/
|
|||
clear = true
|
||||
dependencies = [
|
||||
"pack-build",
|
||||
"pack-rename"
|
||||
"pack-rename",
|
||||
"post-build"
|
||||
]
|
||||
|
||||
[tasks.post-build]
|
||||
command = "wasm-strip"
|
||||
args = ["./pkg/rln_wasm_bg.wasm"]
|
||||
|
||||
[tasks.test]
|
||||
command = "wasm-pack"
|
||||
args = ["test", "--release", "--node"]
|
||||
|
|
|
@ -21,6 +21,11 @@ make installdeps
|
|||
cd rln-wasm
|
||||
cargo make build
|
||||
```
|
||||
4. Compile a slimmer version of zerokit for `wasm32-unknown-unknown`:
|
||||
```
|
||||
cd rln-wasm
|
||||
cargo make post-build
|
||||
```
|
||||
|
||||
## Running tests
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue