0

So Im trying to add source maps to my js project. Im using a very simple uglify command, but every time I run the task, I get an error. Im using uglify 0.5

I have pasted the error and the uglify task below. It minifies and outputs the file just fine. It just will not make the source map. Any help is appreciated.

warning: Unable to write "public/dev/output.min.js.map" file (Error code: undefined). Use --force to continue.

 uglify: {
  dev: {
    options: {
    sourceMap: true
  },
  files: {
    'public/dev/output.min.js': ['*/js/angular/angular.js']
  }
  }
}

Thanks in advance.

MFD3000
  • 854
  • 1
  • 11
  • 26
  • Could be that you are facing this issue: https://github.com/mozilla/source-map/issues/123 I'm still working on getting around it myself. – Moshe Jul 09 '14 at 09:01

1 Answers1

1

In the github issue mentioned above, it points to a bug in source-map v 0.1.35. For a temporary work around, I force the version of source-map in my package.json file by including it like this:

"devDependencies": {
    "source-map":"0.1.34",
    ...
    "grunt-contrib-uglify": "~0.4.0",
    ...
}
Kyle
  • 3,775
  • 6
  • 37
  • 47