Minification for emailjs-imap-client

124 views
Skip to first unread message

Clemens Hofreither

unread,
Mar 3, 2016, 4:58:21 AM3/3/16
to Email.js Mailing List
Hi there,

Is anyone currently actually using emailjs-imap-client in a browser environment? I ask because it uses arrow functions quite extensively and I couldn't find a minifier that supports those out of the box yet. (Uglify seems to have an experimental Harmony branch where they might work.) Or do you just not minify your code?

-- Clemens

James Burke

unread,
Mar 3, 2016, 12:25:09 PM3/3/16
to Clemens Hofreither, Email.js Mailing List
I can see two options:

1) Use escodegen/esmangle. When I looked at it before, esmangle did
not have full es6 support, but that was on the order of a year ago, so
it may be better now. What I ended up doing was just using esprima and
then escodegen to write out the source with comments removed. So, no
identifier replacements/code shortening, but still reduced the size of
the overall app's JS by a good amount.

2) Use babel to translate the source to ES5 then minify using uglifyjs.

James
Reply all
Reply to author
Forward
0 new messages