samccone / The-cost-of-transpiling-es2015-in-2016

Investigating the overhead cost of compiled es2015
1.34k stars 37 forks source link

Add --screw-ie8 to uglifyjs #39

Closed nstepien closed 8 years ago

nstepien commented 8 years ago

I'm sure this is appropriate for most projects.

Plot twist: --screw-ie8 made typescript go up a rank in file size! Coincidence?

samccone commented 8 years ago

oh wow... very strange!

samccone commented 8 years ago

cc @DanielRosenwasser

nstepien commented 8 years ago

Did I misspeak? Every toolchain affected got a slight decrease in filesize, which is good.

samccone commented 8 years ago

oh sorry i misread that :)

go up in a rank I read as causing an increase to the file size :wink:

DanielRosenwasser commented 8 years ago

You caught us, we've always been optimized for that mode. :wink:

samccone commented 8 years ago

:+1: cool stuff guys!

DanielRosenwasser commented 8 years ago

The only difference between the bundles is the way in which default imports are handled. It looks like Browserify makes output safe for ES3 runtimes by switching default property accesses from o.default to o["default"] and --screw-ie8 undoes that work. ¯_(ツ)_/¯