LAFONT
July 18, 2016, 11:12am
1
Hi,
I try to “uglified” the code of an Ionic2 app .
My gulp file is as following:
gulp.task('build', ['clean'], function(done){
runSequence(
['sass', 'html', 'fonts', 'scripts'],
function () {
console.log('isRelease: ' + isRelease);
buildBrowserify({
minify: isRelease,
browserifyOptions: {
debug: !isRelease
},
uglifyOptions: {
mangle: false
}
}).on('end', done);
}
);
});
But with the “mangle: false”, the code is not really “uglified”.
A mangler — reduce names of local variables to (usually) single-letters.
Is there a way to uglify with mangle: true?
1 Like
itlr
July 18, 2016, 10:51pm
2
I hope I understand you correctly but why not simply do mangle:true
?
Anyways, here is the doc for uglifyOptions, compress
looks interesting https://github.com/terinjokes/gulp-uglify#options
LAFONT
July 18, 2016, 11:13pm
3
I have not been clear, sorry.
mangle:true is not supported by Angular2.
I m looking for a “uglify” effective solution. To slow down reverse engineering.
nylex
July 19, 2016, 2:40am
4
are u referring to obfuscation?
itlr
July 19, 2016, 2:51am
5
I’m actually looking for a way to optimize app.bundle.js myself, I just haven’t managed to invest much time yet. How could angular 2 not supporting mangling, isn’t that just about shortening variable names?
itlr
July 19, 2016, 2:52am
6
I"m looking forward to Angular 2’s offline compiler, AFAIK, the stuff is closure compiler based, they they get that to work, it’ll be a huge boost of performance.