Skip to content

Commit

Permalink
alway write compression file
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislearn committed Dec 1, 2023
1 parent ee874f4 commit 7a63059
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions crates/cli/src/compile/front.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,21 +105,21 @@ async fn bindgen(proj: &Project) -> Result<Outcome<Product>> {
_ => {}
}
let data = fs::read(&wasm_file.dest).await?;

let br_file = File::create(format!("{}.br", wasm_file.dest.as_str()))?;
let mut br_writer = CompressorWriter::new(
br_file,
32 * 1024, // 32 KiB buffer
11, // BROTLI_PARAM_QUALITY
22, // BROTLI_PARAM_LGWIN
);
br_writer.write_all(&data)?;

let zstd_data = zstd::encode_all(&*data, 21)?;
let mut zstd_file = File::create(format!("{}.zst", wasm_file.dest.as_str()))?;
zstd_file.write_all(&zstd_data)?;
}

let br_file = File::create(format!("{}.br", wasm_file.dest.as_str()))?;
let mut br_writer = CompressorWriter::new(
br_file,
32 * 1024, // 32 KiB buffer
11, // BROTLI_PARAM_QUALITY
22, // BROTLI_PARAM_LGWIN
);
br_writer.write_all(&data)?;

let zstd_data = zstd::encode_all(&*data, 21)?;
let mut zstd_file = File::create(format!("{}.zst", wasm_file.dest.as_str()))?;
zstd_file.write_all(&zstd_data)?;

let mut js_changed = false;

js_changed |= write_snippets(proj, bindgen.snippets()).await?;
Expand Down

0 comments on commit 7a63059

Please sign in to comment.