I'm using Grunt to concat and minify files (with grunt-contrib-uglify and grunt-contrib-concat ) and I wanted to add a source map. The uglify docs say to just add an option for sourceMap set to a boolean of true. But when I add that to my tasks (I've tried a couple different ones) the process runs fine until it gets to the source map part, then I get:
Writing true...ERROR
Warning: Unable to write "true" file (Error code: undefined). Use --force to continue.
The concatenation is done, the minification is done. But... no luck with the sourcemap.
Sample from my Grunt file:
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= pkg.version %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
},
publicjs: {
options: {
sourceMap: true
},
files: {
'js/<%= pkg.name %>_public.min.js': ['<%= concat.publicjs.dest %>']
}
}
}
(I've also tried with the sourceMap in my top level options object.)
Any ideas? Clearly Grunt can write to the directory because it creates the concatenated and minified files, and I can't think of what else might be the trouble.