From 270b506ff83986eddf20162b24acb7a7ee045b66 Mon Sep 17 00:00:00 2001 From: Adam Sinnett Date: Thu, 18 Apr 2013 14:05:14 -0700 Subject: [PATCH] Add source map generation to closure compiler arguments --- lib/grunt/utils.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/grunt/utils.js b/lib/grunt/utils.js index 0c1fd8ca11e0..09a3ad2c4813 100644 --- a/lib/grunt/utils.js +++ b/lib/grunt/utils.js @@ -123,6 +123,7 @@ module.exports = { min: function(file, done) { var minFile = file.replace(/\.js$/, '.min.js'); + var sourceMapFile = minFile + '.map'; shell.exec( 'java ' + this.java32flags() + ' ' + @@ -130,7 +131,9 @@ module.exports = { '--compilation_level SIMPLE_OPTIMIZATIONS ' + '--language_in ECMASCRIPT5_STRICT ' + '--js ' + file + ' ' + - '--js_output_file ' + minFile, + '--js_output_file ' + minFile + ' ' + + '--create_source_map ' + sourceMapfile + ' ' + + '--source_map_format=V3', function(code) { if (code !== 0) grunt.fail.warn('Error minifying ' + file); grunt.file.write(minFile, this.singleStrict(grunt.file.read(minFile), '\n'));