Added min, qunit, server, and watch tasks to grunt

This commit is contained in:
Ian Gilman 2013-02-14 10:21:35 -08:00
parent 607a4af860
commit d3b010d26e

View File

@ -1,6 +1,7 @@
module.exports = function(grunt) { module.exports = function(grunt) {
var distribution = "openseadragon.js", var distribution = "build/openseadragon.js",
minified = "build/openseadragon.min.js",
sources = [ sources = [
"src/openseadragon.js", "src/openseadragon.js",
"src/eventhandler.js", "src/eventhandler.js",
@ -39,6 +40,23 @@ module.exports = function(grunt) {
dest: distribution dest: distribution
} }
}, },
min: {
openseadragon: {
src: [ distribution ],
dest: minified
}
},
qunit: {
all: [ "http://localhost:8000/test/test.html" ]
},
server: {
port: 8000,
base: "."
},
watch: {
files: [ "grunt.js", "src/*.js" ],
tasks: "default"
},
lint: { lint: {
beforeconcat: sources, beforeconcat: sources,
afterconcat: [ distribution ] afterconcat: [ distribution ]
@ -64,8 +82,10 @@ module.exports = function(grunt) {
} }
}); });
// Default task. // Default task.
grunt.registerTask('default', 'lint:beforeconcat concat lint:afterconcat'); grunt.registerTask("default", "lint:beforeconcat concat lint:afterconcat min");
}; // Test task.
grunt.registerTask("test", "default server qunit");
};