Fixes for --wasm-size-limit option (#3965)

It will use 0 as a default when `--skip-wasm-opt` is given and will be properly propagated to watch command when disabled.
This commit is contained in:
Michał Wawrzyniec Urbańczyk 2022-12-08 23:43:55 +01:00 committed by GitHub
parent 308f4edc21
commit 9edcae2fd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -333,6 +333,8 @@ impl IsWatchable for Wasm {
}
if let Some(wasm_size_limit) = wasm_size_limit {
watch_cmd.args(["--wasm-size-limit", wasm_size_limit.to_string().as_str()]);
} else {
watch_cmd.args(["--wasm-size-limit", "0"]);
}
// === cargo-watch options ===

View File

@ -85,7 +85,11 @@ pub struct BuildInput {
/// Fail the build if compressed WASM exceeds the specified size. Supports format like
/// "4.06MiB". Pass "0" to disable check.
#[clap(long, enso_env(), default_value_if("skip_wasm_opt", Some("true"), Some("0")), maybe_default = DEFAULT_WASM_SIZE_LIMIT.get())]
#[clap(long, enso_env(),
maybe_default = DEFAULT_WASM_SIZE_LIMIT.get(),
default_value_if("skip-wasm-opt", Some("true"), Some("0")),
default_value_if("skip-wasm-opt", None, Some("0")),
)]
pub wasm_size_limit: Option<byte_unit::Byte>,
}