This patch adds file-based dead code elimination (DCE) by analyzing the abstract syntax tree (AST) of the JavaScript files.
The AST gets generated by an adapted version of JSLINT. The mutilation of JSLINT was necessary in order to get the AST more often than not. There may be cases where JSLINT still won't produce an AST because it it so picky about the source code. In that case more modifications will be required or no DCE will be performed.
This patch reduces the average application size of the mwaylabs/The-M-Project-Sample-Apps by solid 20%
This patch has only be tested with mwaylabs/The-M-Project-Sample-Apps, which seem to work...^_^
This patch adds file-based dead code elimination (DCE) by analyzing the abstract syntax tree (AST) of the JavaScript files.
The AST gets generated by an adapted version of JSLINT. The mutilation of JSLINT was necessary in order to get the AST more often than not. There may be cases where JSLINT still won't produce an AST because it it so picky about the source code. In that case more modifications will be required or no DCE will be performed.
This patch reduces the average application size of the mwaylabs/The-M-Project-Sample-Apps by solid 20%
This patch has only be tested with mwaylabs/The-M-Project-Sample-Apps, which seem to work...^_^