-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
62 lines (57 loc) · 1.8 KB
/
Gruntfile.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
"use strict";
module.exports = function (grunt) {
grunt.initConfig({
jshint: {
src: ['js/**/*.js', '!node_modules/**/*.*', '!js/lib/**/*.js'],
options: {
jshintrc: '.jshintrc'
}
},
karma: {
unit: {
configFile: 'karma.conf.js',
singleRun: true
}
},
watch: {
js: {
files: ['**/*.js', '!**/node_modules/**'],
tasks: ['lint', 'test']
}
},
connect: {
server: {
options: {
port: 9001,
middleware: function(connect) {
return [
function(req, res, next) {
res.setHeader('Access-Control-Allow-Origin', "*");
next();
},
connect.static('./')
]
}
}
}
},
'gh-pages': {
options: {
base: '',
message: 'Publish from master',
add: true //won't remove remote files, so we can put our google analytics on the branch
},
src: ['**']
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-gh-pages');
grunt.registerTask('lint', ['jshint']);
grunt.registerTask('test', ['karma']);
grunt.registerTask('server', ['connect', 'watch']);
grunt.registerTask('publish', ['gh-pages']);
grunt.registerTask('default', ['lint', 'test']);
};