We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c385071 commit 4e7c34bCopy full SHA for 4e7c34b
packages/wasm-miniscript/Makefile
@@ -1,12 +1,18 @@
1
WASM_PACK = wasm-pack
2
+WASM_OPT = wasm-opt
3
WASM_PACK_FLAGS = --no-pack --weak-refs
4
5
ifdef WASM_PACK_DEV
6
WASM_PACK_FLAGS += --dev
7
endif
8
9
define WASM_PACK_COMMAND
- $(WASM_PACK) build --out-dir $(1) $(WASM_PACK_FLAGS) --target $(2)
10
+ $(WASM_PACK) build --no-opt --out-dir $(1) $(WASM_PACK_FLAGS) --target $(2)
11
+endef
12
+
13
+# run wasm-opt separately so we can pass `--enable-bulk-memory`
14
+define WASM_OPT_COMMAND
15
+ $(WASM_OPT) --enable-bulk-memory -Oz $(1)/*.wasm -o $(1)/*.wasm
16
endef
17
18
define REMOVE_GITIGNORE
@@ -22,6 +28,7 @@ endef
22
28
define BUILD
23
29
rm -rf $(1)
24
30
$(call WASM_PACK_COMMAND,$(1),$(2))
31
+ $(call WASM_OPT_COMMAND,$(1))
25
32
$(call REMOVE_GITIGNORE,$(1))
26
33
$(call SHOW_WASM_SIZE,$(1))
27
34
0 commit comments