I'm trying to make sourcemaps to play nice while i'm using Grunt and UglifyJS Grunt task.
Here is the current task:
uglify: {
dist: {
options: {
sourceMap: function(path) {
return path + ".map";
},
},
files: {
'dist/video.min.js': [ 'javascripts/video.js' ]
}
}
}
What's the problem?
The sourcemap is generated but Chrome is searching for the sourcemap in the wrong location ( that is dist/dist/video.min.js.map
). I know this because i get 404 in console.
So I edited dist/video.min.js
and changed sourceMappingURL
to point to correct location. Now, the sourcemap is loaded but is looking for video.js in completely wrong place: dist/javascripts/video.js
(that dist again!)
So basically now i'm out of any ideas, just poking the gruntfile with no luck.
Any ideas? Thanks!
It seems that http://github.com/gruntjs/grunt-contrib-uglify/issues/71 is a potential fix.
Bummer, i always find the solution after i post on SO. This place is magic!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With