mirror of
https://github.com/swc-project/swc.git
synced 2024-12-22 21:21:31 +03:00
test(es/minifier): Organize simple size tests (#5402)
This commit is contained in:
parent
36d275a6dc
commit
7b8658eef2
4
crates/dbg-swc/scripts/reduce-list.sh
Executable file
4
crates/dbg-swc/scripts/reduce-list.sh
Executable file
@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
|
||||
cat list.txt | xargs -L 1 -I {} ./scripts/reduce-size.sh {}
|
@ -48,7 +48,22 @@ impl EnsureSize {
|
||||
return Ok(());
|
||||
}
|
||||
for report in &results {
|
||||
println!();
|
||||
println!("{}", report.fm.name);
|
||||
|
||||
if let Some(terser) = &report.terser {
|
||||
if report.swc.mangled_size > terser.mangled_size {
|
||||
println!(" Mangled");
|
||||
println!(" swc: {} bytes", report.swc.mangled_size);
|
||||
println!(" terser: {} bytes", terser.mangled_size);
|
||||
}
|
||||
|
||||
if report.swc.no_mangle_size > terser.no_mangle_size {
|
||||
println!(" No-mangle");
|
||||
println!(" swc: {} bytes", report.swc.no_mangle_size);
|
||||
println!(" terser: {} bytes", terser.no_mangle_size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bail!("found some issues")
|
||||
|
@ -0,0 +1 @@
|
||||
[]({a(){window}})
|
@ -0,0 +1 @@
|
||||
[]({a(){}})
|
Loading…
Reference in New Issue
Block a user