diff --git a/Gruntfile.js b/Gruntfile.js index a90a0974..0cd48304 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -52,6 +52,11 @@ module.exports = function(grunt) { "src/viewport.js" ]; + // ---------- + grunt.event.once('git-describe', function (rev) { + grunt.config.set('gitInfo', rev); + }); + // ---------- // Project configuration. grunt.initConfig({ @@ -101,12 +106,8 @@ module.exports = function(grunt) { uglify: { options: { preserveComments: "some", - sourceMap: function (filename) { - return filename.replace(/\.js$/, '.js.map'); - }, - sourceMappingURL: function (filename) { - return filename.replace(/\.js$/, '.js.map').replace('build/openseadragon/', ''); - }, + sourceMap: true, + sourceMapName: 'build/openseadragon/openseadragon.min.js.map' }, openseadragon: { src: [ distribution ], @@ -161,11 +162,7 @@ module.exports = function(grunt) { afterconcat: [ distribution ] }, "git-describe": { - build: { - options: { - prop: "gitInfo" - } - } + build: {} } }); diff --git a/package.json b/package.json index aa123561..70ce5a73 100644 --- a/package.json +++ b/package.json @@ -3,17 +3,17 @@ "version": "1.1.1", "description": "Provides a smooth, zoomable user interface for HTML/Javascript.", "devDependencies": { - "grunt": "~0.4.1", - "grunt-contrib-compress": "~0.5.2", - "grunt-contrib-concat": "~0.3.0", - "grunt-contrib-jshint": "~0.7.2", - "grunt-contrib-uglify": "~0.2.7", - "grunt-contrib-qunit": "~0.3.0", - "grunt-contrib-connect": "~0.5.0", - "grunt-contrib-watch": "~0.5.3", - "grunt-contrib-clean": "~0.5.0", - "grunt-git-describe": "~2.0.0", - "grunt-text-replace": "~0.3.9" + "grunt": "^0.4.5", + "grunt-contrib-clean": "^0.5.0", + "grunt-text-replace": "^0.3.11", + "grunt-contrib-concat": "^0.4.0", + "grunt-git-describe": "^2.3.2", + "grunt-contrib-uglify": "^0.4.0", + "grunt-contrib-watch": "^0.6.1", + "grunt-contrib-qunit": "^0.5.1", + "grunt-contrib-jshint": "^0.10.0", + "grunt-contrib-compress": "^0.9.1", + "grunt-contrib-connect": "^0.7.1" }, "scripts": { "test": "grunt test" diff --git a/src/openseadragon.js b/src/openseadragon.js index 14ddd3d5..0c167934 100644 --- a/src/openseadragon.js +++ b/src/openseadragon.js @@ -656,14 +656,12 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){ * @property {Number} revision - The revision number. * @since 1.0.0 */ - /* jshint ignore:start */ $.version = { versionStr: '<%= osdVersion.versionStr %>', - major: <%= osdVersion.major %>, - minor: <%= osdVersion.minor %>, - revision: <%= osdVersion.revision %> + major: parseInt('<%= osdVersion.major %>', 10), + minor: parseInt('<%= osdVersion.minor %>', 10), + revision: parseInt('<%= osdVersion.revision %>', 10) }; - /* jshint ignore:end */ /**