4 ms·
Wow, I've been thinking the exact same thing for a long time. In principle there's no need to limit it to file-level granularity. Take for example a JS minifi
by xamuel 11y ago
Wow, I've been thinking the exact same thing for a long time.
In principle there's no need to limit it to file-level granularity. Take for example a JS minifier-compressor where human-readability isn't a goal. If you're compressing a javascript file with a bunch of top-level functions, it shouldn't matter which order the functions are expressed, thanks to hoisting.
Once you make that jump, it's not even limited to re-ordering things. The minifier-compressor could also consider all possible results of swapping singlequote and doublequote, x['this'] vs. x.this when appropriate, and so on.