Skip to content

Commit 8a95dde

Browse files
committed
Optimize build to reduce wasm size 12% or so
Tested opt-level 'z' too, doesn't seem to make any difference.
1 parent 9b5d0d0 commit 8a95dde

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ crate-type = ["cdylib", "rlib"]
1313
[features]
1414
default = ["wee_alloc", "console_error_panic_hook"]
1515

16+
[profile.release]
17+
lto = true
18+
opt-level = 's'
19+
1620
[dependencies]
1721
wasm-bindgen = "0.2"
1822
brotli = "3.3"

build.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ if (!shell.which('wasm-pack')) {
66

77
// Clean up any existing built content:
88
shell.rm('-rf', 'dist');
9+
shell.rm('-rf', 'pkg.*');
910
shell.mkdir('dist');
1011

1112
// Create the bundler output

0 commit comments

Comments
 (0)