-
Notifications
You must be signed in to change notification settings - Fork 1
/
grunt.js
executable file
·77 lines (72 loc) · 1.74 KB
/
grunt.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*
* grunt
* http://gruntjs.com/
*
* Copyright (c) 2012 "Cowboy" Ben Alman
* Licensed under the MIT license.LiveReload
* https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT
*/
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-reload');
// Project configuration.
grunt.initConfig({
test: {
all: ['test/**/*.js']
},
lint: {
all: [
'grunt.js',
'col/js/*.js',
'tasks/*.js',
'tasks/*/*.js',
'test/{grunt,tasks,util}/*.js'
]
},
watch: {
files:['*.html', '*.css', '*.js'],
tasks:'reload'
},
server: {
port: 8081,
base:".",
keepalive:true
},
reload: {
port: 8081,
proxy: {
host: 'localhost'
}
},
jshint: {
options: {
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
boss: true,
eqnull: true,
node: true,
es5: true,
strict: false
},
globals: {}
}
});
grunt.registerTask('wait', 'Wait for a set amount of time.', function(delay) {
var d = delay ? delay + ' second' + (delay === '1' ? '' : 's') : 'forever';
grunt.log.write('Waiting ' + d + '...');
// Make this task asynchronous. Grunt will not continue processing
// subsequent tasks until done() is called.
var done = this.async();
// If a delay was specified, call done() after that many seconds.
if (delay) { setTimeout(done, delay * 1000); }
});
// Default task.
// grunt.registerTask('develop', 'server wait watch reload');
grunt.registerTask('develop', 'reload server');
grunt.registerTask('default', 'lint server watch test');
};