grunt-contrib-uglify
grunt-contrib-uglify copied to clipboard
SourceMapIn for globbed files should support multiple sourceMapIn's
Example:
module.exports = (grunt) ->
grunt.loadNpmTasks("grunt-contrib-uglify")
grunt.loadNpmTasks("grunt-contrib-coffee")
grunt.initConfig
pkg: grunt.file.readJSON('package.json')
uglify:
options:
mangle:
except:['jQuery']
dist:
options:
sourceMap:true
sourceMapIncludeSources:true
sourceMapIn: (file) ->
"scripts/maps/#{file}.map"
files: [
expand: true
flatten: true
cwd: "scripts/"
src: ["*.js"]
dest: "scripts/"
ext: ".min.js"
]
coffee:
compile:
options:
join: false
sourceMapDir: "scripts/maps"
sourceMap: true
files: [
expand: true
flatten: true
cwd: "coffee"
src: "*.coffee"
dest: "scripts/"
ext: ".js"
]
grunt.registerTask("compile","Compile coffeescript",["coffee:compile","uglify:dist"])
This should work, reading in each sourcemap for each coffeescript file, and using the correct source map. Instead, an error explicitly acknowledging this lack of support comes up.
I would love to see this implemented. I think we could do it by allowing that variable to be an array of strings or a glob.
Would be nice. I'm using both coffeescript as well as concat. It's a bit of a pain that you can't pull both the sourcemaps in.
Would be helpful. What i'm trying to do is take a bunch of JS files and CoffeeScript files, compress them into one .js file, and have all the proper sourcemaps generated so that it can be easily debugged.
FYI I found a tool that does exactly that. grunt-contrib-mapcat. Works great!
+1. This is very frustrating.
+1
+1
+1
+1
+1
+1
+1