emscripten-core/emscripten

Switch from Terser to escodegen

Open

#12,410 建立於 2020年10月2日

在 GitHub 查看
 (20 留言) (0 反應) (0 負責人)C++ (3,519 fork)batch import
help wanted

倉庫指標

Star
 (27,361 star)
PR 合併指標
 (平均合併 19天 10小時) (30 天內合併 147 個 PR)

描述

Raising an issue for tracking: such switch should simplify and speed up code generation, and allow us to avoid custom patches we have in Terser.

Background (https://github.com/emscripten-core/emscripten/issues/11303#issuecomment-702853752):

@kripken: We don't use terser for minification. In tools/acorn_optimizer.js it's used to convert an acorn AST to JS (so it's in support of the passes in that file, which are almost all not minification-related). Maybe there's a better way or simpler tool for that? I remember I couldn't find one at the time.

@rreverser: Ah, that's what I thought after looking at the code. Yeah, there is estools/escodegen which, among other ESTree tools in that org, was created specifically as a simple AST-to-JS generator. It should be both simpler and much faster than going via all Terser's conversions.

貢獻者指南