Uglifying fails

I know I might be little bit ahead of time, but have anyone tried to uglify the app.bundle.js in alpha.54? Been trying gulp-minify({mangle:false}) without problems and it will shrink a lot, but is still readable… =(

I was just reading on another site that someone else had similar problem with angular.beta1 and it was solved in beta2, but the problem seem to be back in beta4 again, or is it in the ionic code?

To reproduce:

  1. ionic start MyIonicProject --ts --v2
  2. webpack --optimize-minimize

Error in Firefox console:

EXCEPTION: No provider for e! (e -> e)

I’m not sure if you are supposed to uglify the code yet, in angular 1 you would add a string just before the DI, but in Angular 2 that doesn’t exist, when you use the gulp-minify plugin, does it also uglify? minifying as far as i know is about deleting unnecesary space characters like new-lines and multiple-space to a single space, and uglify consists in renaming variables to shorter ones but keeping the functionality in order to cut file sizes.

  1. Does gulp-minify also uglify?
  2. Does webpack --optimize-minimize minify, uglify or both?
  1. Yes, as I understand it is using UglifyJS2, but can be turned of by setting mangle to false.
  2. Both

As for webpack, in production mode you run

which equals to

and that will force both uglifying and minifying… so for the moment I only run webpack without flags and then use gulp-minify or gulp-uglify with mangle:false to make the bundle file aprox 50% smaller…

Does it work with mangle:true? if it does then theoretically webpack --optimize-minimize should work, if not you will have to wait until ionic team work the production pipeline out.

My guess is that webpack is using uglify with mangle:true since the output look the same. Guess we need to wait for a ng-annotate tool for ng2 for directives…

Lots of for’s here… tired :slightly_smiling:

for’s? what do you mean?

In my last sentance I said “for” multiple times, never mind… tired as I said before. Anyway, I am looking for a release of my app within two months, hope my code can be scrambled until then…