swc/ecmascript/minifier
강동윤 3c3fb359ee
fix(es): Remove UB (#1815)
swc_ecma_parser:
 - Remove UB.

swc_ecma_codegen:
 - Remove codes related to the UB of the parser. (#1782)
2021-06-12 05:17:09 +00:00
..
scripts feat(es/minifier): Implement rules and classify tests (#1750) 2021-05-28 19:44:03 +09:00
src fix(es): Remove UB (#1815) 2021-06-12 05:17:09 +00:00
tests fix(es/transforms/base): Wrap binary operands of unary expressions. (#1793) 2021-06-05 12:58:50 +00:00
Cargo.toml fix(es): Remove UB (#1815) 2021-06-12 05:17:09 +00:00
README.md feat(es/minifier): Implement more rules (#1735) 2021-05-25 16:39:07 +09:00

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.

Testing

Tests ported from terser has

  • input.js
  • config.json
  • mangle.json (if name mangling is enabled)
  • output.js (if exists and can be modified if our one is better or due to lack of frequency-aware base54)
  • output.terser.js (if exists)

Copying tests

Replace the content of terser/test/compress.js with it of scripts/compress.js and run npm run test:compress