From d6dfc15351fd46809e55a456ba33d8e23aff67ca Mon Sep 17 00:00:00 2001 From: Ian Gilman Date: Thu, 21 Feb 2013 10:45:14 -0800 Subject: [PATCH] Updated gruntfile and package.json for grunt 0.4.0 --- Gruntfile.js | 55 +++++++++++++++++++++++++--------------------------- package.json | 30 ++++++++++++++++------------ 2 files changed, 44 insertions(+), 41 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 3c93539e..66233645 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,6 +1,12 @@ module.exports = function(grunt) { grunt.loadNpmTasks("grunt-contrib-compress"); + grunt.loadNpmTasks('grunt-contrib-concat'); + grunt.loadNpmTasks('grunt-contrib-jshint'); + grunt.loadNpmTasks('grunt-contrib-uglify'); + grunt.loadNpmTasks('grunt-contrib-qunit'); + grunt.loadNpmTasks('grunt-contrib-connect'); + grunt.loadNpmTasks('grunt-contrib-watch'); var distribution = "build/openseadragon.js", minified = "build/openseadragon.min.js", @@ -37,16 +43,16 @@ module.exports = function(grunt) { // Project configuration. grunt.initConfig({ pkg: "", - meta: { - banner: "/**\n * @version <%= pkg.name %> <%= pkg.version %>\n */" - }, concat: { + options: { + banner: "/**\n * @version <%= pkg.name %> <%= pkg.version %>\n */" + }, dist: { src: [ "" ].concat(sources), dest: distribution } }, - min: { + uglify: { openseadragon: { src: [ distribution ], dest: minified @@ -67,36 +73,27 @@ module.exports = function(grunt) { qunit: { all: [ "http://localhost:8000/test/test.html" ] }, - server: { - port: 8000, - base: "." + connect: { + options: { + port: 8000, + base: "." + } }, watch: { files: [ "grunt.js", "src/*.js" ], tasks: "default" }, - lint: { - beforeconcat: sources, - afterconcat: [ distribution ] - }, jshint: { options: { - browser: true, - eqeqeq: false, - loopfunc: false - /*curly: true, - eqeqeq: true, - immed: true, - latedef: true, - newcap: true, - noarg: true, - sub: true, - undef: true, - eqnull: true,*/ + browser: true, + eqeqeq: false, + loopfunc: false, + globals: { + OpenSeadragon: true + } }, - globals: { - OpenSeadragon: true - } + beforeconcat: sources, + afterconcat: [ distribution ] } }); @@ -108,12 +105,12 @@ module.exports = function(grunt) { }); // Default task. - grunt.registerTask("default", "lint:beforeconcat concat lint:afterconcat min copy"); + grunt.registerTask("default", ["jshint:beforeconcat", "concat", "jshint:afterconcat", "uglify", "copy"]); // Test task. - grunt.registerTask("test", "default server qunit"); + grunt.registerTask("test", ["default", "connect", "qunit"]); // Package task. - grunt.registerTask("package", "default compress"); + grunt.registerTask("package", ["default", "compress"]); }; diff --git a/package.json b/package.json index 1df4ea7d..b8fe582d 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,20 @@ { - "name": "OpenSeadragon", - "version": "0.9.120", - "description": "Provides a smooth, zoomable user interface for HTML/Javascript.", - "dependencies": { - "grunt": "0.3.17", - "qunitjs": "1.11.0", - "phantomjs": "1.8.1-3", - "grunt-contrib-compress": "0.3.3" - }, - "scripts": { - "test": "grunt test" - } + "name": "OpenSeadragon", + "version": "0.9.120", + "description": "Provides a smooth, zoomable user interface for HTML/Javascript.", + "dependencies": { + "grunt": "~0.4.0", + "qunitjs": "1.11.0", + "phantomjs": "1.8.1-3", + "grunt-contrib-compress": "~0.4.0", + "grunt-contrib-concat": "~0.1.2", + "grunt-contrib-jshint": "~0.1.1", + "grunt-contrib-uglify": "~0.1.1", + "grunt-contrib-qunit": "~0.1.1", + "grunt-contrib-connect": "~0.1.2", + "grunt-contrib-watch": "~0.2.0" + }, + "scripts": { + "test": "grunt test" + } }