From c17f22f82bf701dd25ea462fb8ab1b537f7361e1 Mon Sep 17 00:00:00 2001 From: Antoine Vandecreme Date: Tue, 26 Jan 2016 18:16:54 -0500 Subject: [PATCH] Generate source map for concat. Remove comments except banner for min. --- Gruntfile.js | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 8c7ff60a..2328bb37 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -57,6 +57,12 @@ module.exports = function(grunt) { "src/world.js" ]; + var banner = "//! <%= pkg.name %> <%= pkg.version %>\n" + + "//! Built on <%= grunt.template.today('yyyy-mm-dd') %>\n" + + "//! Git commit: <%= gitInfo %>\n" + + "//! http://openseadragon.github.io\n" + + "//! License: http://openseadragon.github.io/license/\n\n"; + // ---------- grunt.event.once('git-describe', function (rev) { grunt.config.set('gitInfo', rev); @@ -85,12 +91,9 @@ module.exports = function(grunt) { }, concat: { options: { - banner: "//! <%= pkg.name %> <%= pkg.version %>\n" + - "//! Built on <%= grunt.template.today('yyyy-mm-dd') %>\n" + - "//! Git commit: <%= gitInfo %>\n" + - "//! http://openseadragon.github.io\n" + - "//! License: http://openseadragon.github.io/license/\n\n", - process: true + banner: banner, + process: true, + sourceMap: true }, dist: { src: [ "" ].concat(sources), @@ -111,9 +114,11 @@ module.exports = function(grunt) { }, uglify: { options: { - preserveComments: "some", + preserveComments: false, + banner: banner, sourceMap: true, - sourceMapName: 'build/openseadragon/openseadragon.min.js.map' + sourceMapName: 'build/openseadragon/openseadragon.min.js.map', + sourceMapIn: 'build/openseadragon/openseadragon.js.map' }, openseadragon: { src: [ distribution ],