browserify / tinyify

a browserify plugin that runs various optimizations, so you don't have to install them all manually. makes your bundles tiny!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

es2015+ support

opened this issue · comments

@mikeal pointed out on twitter that uglify doesn't have support for new es2015+ syntax, so to use the new syntax with tinyify right now, you'd have to do something like:

browserify -t [ babelify --presets [ es2017 ] ] -p tinyify main.js

However, this means that you're opting out of some of the optimizations that engines can do with the new syntax that can only be realized by leaving the syntax in the output.

It seems like uglify-es is an API-compatible replacement for uglify that understands new syntax.

Update: I dug into uglifyify and it already uses uglify-es! And wait a sec, this already works:

$ browserify -p tinyify main.js; echo
!async function(){await async function(){console.log("wow")}()}();

Nevermind this issue then!