我使用concat将JS文件合并到一个文件中,并使用uglify来最小化JavaScript.如何创建使用源JS文件的sourcemaps文件?
我目前的gruntfile:
concat: {
options: {
// define a string to put between each file in the concatenated output
separator: ';'
},
dist: {
// the files to concatenate
src: ['<%= config.src %>/js/**/*.js'],
// the location of the resulting JS file
dest: '<%= config.dist %>/js/main.js'
}
},
uglify: {
dist: {
files: {
'<%= config.dist %>/js/main.min.js': ['<%= concat.dist.dest %>']
}
}
},
Run Code Online (Sandbox Code Playgroud) gruntjs source-maps grunt-contrib-concat grunt-contrib-uglify