diff --git a/grunt.js b/Gruntfile.js similarity index 82% rename from grunt.js rename to Gruntfile.js index 65db9b8..746ddcf 100644 --- a/grunt.js +++ b/Gruntfile.js @@ -12,9 +12,6 @@ module.exports = function(grunt) { pre: '(function(window, document, undefined){', post: '})(window,document);' }, - lint: { - files: ['build/<%= pkg.name %>.js'] - }, qunit: { files: ['tests/qunit/index.html'] }, @@ -24,7 +21,7 @@ module.exports = function(grunt) { dest: 'build/<%= pkg.name %>.js' } }, - min: { + uglify: { dist: { src: ['', ''], dest: 'build/<%= pkg.name %>.min.js' @@ -35,6 +32,7 @@ module.exports = function(grunt) { tasks: 'lint qunit' }, jshint: { + all: ['build/<%= pkg.name %>.js'], options: { curly: true, eqeqeq: true, @@ -51,8 +49,7 @@ module.exports = function(grunt) { globals: { jQuery: true } - }, - uglify: {} + } }); var selenium = require("./tests/selenium.js"); @@ -67,7 +64,13 @@ module.exports = function(grunt) { } }); + // Load tasks + grunt.loadNpmTasks('grunt-contrib-concat'); + grunt.loadNpmTasks('grunt-contrib-uglify'); + grunt.loadNpmTasks('grunt-contrib-jshint'); + grunt.loadNpmTasks('grunt-contrib-qunit'); + // Default task. - grunt.registerTask('default', 'concat lint qunit min webdriver'); + grunt.registerTask('default', ['concat', 'jshint', 'qunit', 'uglify', 'webdriver']); }; diff --git a/package.json b/package.json index 91a07a2..28cb563 100644 --- a/package.json +++ b/package.json @@ -6,11 +6,21 @@ "author": { "name":"Niklas von Hertzen (@niklasvh)" }, + "engines": { + "node": ">=0.8.0" + }, "dependencies": { "base64-arraybuffer": ">= 0.1.0", "png-js": ">= 0.1.1", "webdriver.js": ">= 0.1.0" }, + "devDependencies":{ + "grunt": ">=0.4.0", + "grunt-contrib-concat": "*", + "grunt-contrib-uglify": "*", + "grunt-contrib-jshint": "*", + "grunt-contrib-qunit": "*" + }, "homepage": "http://html2canvas.hertzen.com", "licenses": [{ "type": "MIT"