getting started with grunt (and bower) and setting up a default build process for myself I found myself a little lost regarding the minification of scripts using uglify.
I've always used the minified version of scripts in the past but now that I'm trying to a)package manage everything, and b) create a build process I'm gabbing the unminified versions of all the libraries / plugins I want in my project and concatenating and then minifying my self.
It seems to come out alright with no errors so far, but I'm concerned I'm missing something.
Is it standard practice just to slam libraries like jquery / backbone / underscores etc through uglify with its default settings and thats it? or should I be turning mangling off for these libraries ?
I've read a couple tutorials and the grunt uglify plugin readme and its still unclear.
How are you handling minifying libraries like these with grunt ? (if at all)
currently my uglify task looks like this :
uglify: {
my_target: {
options : {
sourceMap: true,
mangle : false // can i mange?
},
files: [{
expand : true,
cwd : '<%= dirs.jsBuild %>',
src : '*.js',
dest : '<%= dirs.js %>'
}]
}
},
note I've concatenated my libraries in order into a file called libs.min.js and my everything in my plugins folder into a file called plugins.min.js which are then being passed to uglify.
I've run it at as the following with no errors so far.....
uglify: {
my_target: {
options : {
sourceMap: true
},
files: [{
expand : true,
cwd : '<%= dirs.jsBuild %>',
src : '*.js',
dest : '<%= dirs.js %>',
ext : '.min.js'
}]
}
},