grunt-contrib-uglify icon indicating copy to clipboard operation
grunt-contrib-uglify copied to clipboard

SourceMapIn for globbed files should support multiple sourceMapIn's

Open tigerhawkvok opened this issue 10 years ago • 12 comments

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.

tigerhawkvok avatar Jan 28 '15 05:01 tigerhawkvok

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.

jimthedev avatar Jun 17 '15 14:06 jimthedev

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.

richard16 avatar Jul 23 '15 18:07 richard16

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.

betam4x avatar Aug 13 '15 02:08 betam4x

FYI I found a tool that does exactly that. grunt-contrib-mapcat. Works great!

betam4x avatar Aug 13 '15 05:08 betam4x

+1. This is very frustrating.

jvilk avatar Oct 05 '15 23:10 jvilk

+1

stefan-- avatar Dec 12 '15 19:12 stefan--

+1

godo13405 avatar May 16 '16 07:05 godo13405

+1

abirmingham avatar Jun 09 '16 20:06 abirmingham

+1

bartoszbobin avatar Jul 29 '16 09:07 bartoszbobin

+1

paulohenriqgoes avatar Sep 20 '16 14:09 paulohenriqgoes

+1

fean avatar Dec 29 '16 11:12 fean

+1

audunolsen avatar Apr 25 '17 16:04 audunolsen