swc_ecma_minifier

Crates.ioswc_ecma_minifier
lib.rsswc_ecma_minifier
version0.197.1
sourcesrc
created_at2021-05-20 06:17:02.108466
updated_at2024-06-25 03:47:23.449619
descriptionEcmaScript code minifier.
homepage
repositoryhttps://github.com/swc-project/swc.git
max_upload_size
id399864
size1,167,659
SWC Bot (swc-bot)

documentation

https://rustdoc.swc.rs/swc_ecma_minifier/

README

Minifier

EcmaScript minifier for the SWC project. This is basically a port of terser.

Note

Currently name mangler is very simple. To focus on creating a MVP, I (kdy1) will use simple logic for name mangler and implement the content-aware name mangler after publishing first non-beta version.

Debugging tips

If the output contains variables named e, t, n it typically means the original library is published in a minified form and the input contains eval. The current swc name mangler does not do anything if eval is used.

Profiling the minifier

From mac os x, run

./scripts/instrument/all.sh path/to/input/dir
Commit count: 9007

cargo fmt