Skip to content

Commit cc5f1cf

Browse files
committed
Added 'clean' and 'connect' grunt plugins
1 parent 917c438 commit cc5f1cf

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

Gruntfile.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ var testacular = require('testacular');
33
/*global module:false*/
44
module.exports = function (grunt) {
55

6+
grunt.loadNpmTasks('grunt-contrib-clean');
67
grunt.loadNpmTasks('grunt-contrib-concat');
78
grunt.loadNpmTasks('grunt-contrib-uglify');
89
grunt.loadNpmTasks('grunt-contrib-jshint');
910
grunt.loadNpmTasks('grunt-contrib-watch');
11+
grunt.loadNpmTasks('grunt-contrib-connect');
1012

1113
// Project configuration.
1214
grunt.initConfig({
@@ -20,6 +22,7 @@ module.exports = function (grunt) {
2022
prefix: '(function (window, angular, undefined) {',
2123
suffix: '})(window, window.angular);'
2224
},
25+
clean: [ '<%= builddir %>' ],
2326
concat: {
2427
build: {
2528
src: [
@@ -52,14 +55,17 @@ module.exports = function (grunt) {
5255
},
5356
watch: {
5457
files: ['src/*.js', 'test/**/*.js'],
55-
tasks: 'build test'
58+
tasks: ['build', 'test']
59+
},
60+
connect: {
61+
server: {}
5662
}
5763
});
5864

59-
// Default task.
60-
grunt.registerTask('build', ['concat', 'uglify']);
61-
grunt.registerTask('dist', ['build', 'jsdoc']);
6265
grunt.registerTask('default', ['build', 'jshint', 'test']);
66+
grunt.registerTask('build', 'Perform a normal build', ['concat', 'uglify']);
67+
grunt.registerTask('dist', 'Perform a clean build and generate documentation', ['clean', 'build', 'jsdoc']);
68+
grunt.registerTask('dev', 'Run dev server and watch for changes', ['build', 'connect', 'watch']);
6369

6470
grunt.registerTask('test-server', 'Start testacular server', function () {
6571
//Mark the task as async but never call done, so the server stays up

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
"grunt-contrib-concat": "~0.1.3",
1111
"grunt-contrib-uglify": "~0.2.0",
1212
"grunt-contrib-jshint": "~0.3.0",
13-
"grunt-contrib-watch": "~0.3.1"
13+
"grunt-contrib-watch": "~0.3.1",
14+
"grunt-contrib-connect": "~0.2.0",
15+
"grunt-contrib-clean": "~0.4.0"
1416
}
1517
}

0 commit comments

Comments
 (0)