When we build apps, we run jsanalyze from our titanium-sdk node modules. That file is specifically used to:
- Parse the JS file (validity check)
- Walk the AST and collect/record Ti.* API usages
- Optionally, minify the code
Unfortunately, uglifyjs hasn't supported ES6 and has lagged for years. Nowadays, people typically use babel and related projects. We should replace our usage of uglifyjs with babel-related modules so that we can parse ES6+ code.
Specifically we can use babylon for parsing, babel-traverse/babel-core/babel-types for AST walking, and babili preset for minification.