You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note 1: uglifyjs is called twice there. First to --compress and second to --mangle. This is necessary! Otherwise uglifyjs will ignore our pure_funcs flag.
However, the caveat is that parcel only performs Terser compress per JS asset and does not perform compress on the final bundle. It would produce a smaller bundle if each asset were not minified individually, but instead only invoke minify on the final bundle - as webpack and rollup typically do.
馃悰 bug report
To be most effective, Elm minification with
uglifyjs
should be done in two phases. It is currently done in one phase.馃 Expected Behavior
The minification process does something analogous to this:
As seen in the official Elm page:
馃槸 Current Behavior
Currently the options passed to
uglifyjs
have both compress and mangle options set, anduglifyjs
is only called once, as seen here: https://github.com/parcel-bundler/parcel/blob/master/src/assets/ElmAsset.js#L89-L119Thus, there are gains to be ... gained! 馃 馃槄
馃拋 Possible Solution
Let's call the
uglifyjs
twice, with two different options, closely modelling the recommended CLI usage.The text was updated successfully, but these errors were encountered: