You need to enable source maps on both the concat
and uglify
tasks, and you must specify the sourceMapIn
option for the uglify task.
Here's a sample grunt config:
concat : {
options : {
sourceMap :true
},
dist : {
src : ['www/js/**/*.js'],
dest : '.tmp/main.js'
}
},
uglify : {
options : {
sourceMap : true,
sourceMapIncludeSources : true,
sourceMapIn : '.tmp/main.js.map'
},
dist : {
src : '<%= concat.dist.dest %>',
dest : 'www/main.min.js'
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…