mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-29 06:28:12 +08:00
Switch production builds from -Os to -Oz to avoid 25 MB deployment limit (#4309)
This commit is contained in:
@@ -70,7 +70,9 @@ pub fn build_wasm_steps(release: bool, native: bool) -> Vec<Expression> {
|
|||||||
|
|
||||||
if release {
|
if release {
|
||||||
let wasm_file = pkg_dir.join(format!("{OUT_NAME}_bg.wasm"));
|
let wasm_file = pkg_dir.join(format!("{OUT_NAME}_bg.wasm"));
|
||||||
steps.push(cmd!("wasm-opt", "-Os", "-g", &wasm_file, "-o", &wasm_file));
|
// `-Oz` (size over speed) keeps us under Cloudflare Pages' 25 MiB single-file cap.
|
||||||
|
// `-g` preserves the name section, which the panic hook reads at runtime to spot node-graph panics (see wrapper `lib.rs`).
|
||||||
|
steps.push(cmd!("wasm-opt", "-Oz", "-g", &wasm_file, "-o", &wasm_file));
|
||||||
}
|
}
|
||||||
|
|
||||||
steps
|
steps
|
||||||
|
|||||||
Reference in New Issue
Block a user