-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathGruntfile.js
79 lines (71 loc) · 2.12 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
'use strict';
module.exports = function(grunt){
grunt.initConfig({
'watch' : {
options : {
livereload : '<%= connect.options.livereload %>'
},
files : [
'Gruntfile.js',
'src/**/**'
],
tasks : ['demo']
},
'connect': {
options: {
port : 9000,
livereload : 9090,
hostname : 'localhost'
},
livereload: {
options: {
open : true,
middleware : function (connect) {
return [
connect.static('demo'),
connect().use('/bower_components', connect.static('./bower_components')),
connect().use('/src', connect.static('./src'))
];
}
}
}
},
'karma' : {
unit : {
configFile : 'test/karma.conf.js',
singleRun : true
}
},
'jshint' : {
options: {
jshintrc : '.jshintrc',
reporter : require('jshint-stylish')
},
all : {
src : ['Gruntfile.js', 'src/*.js']
}
},
'uglify': {
source : {
files : {
'src/cr-bootstrap-navbar.min.js' : ['src/cr-bootstrap-navbar.js']
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-karma');
grunt.registerTask('test', function(){
grunt.task.run(['karma']);
});
grunt.registerTask('demo', function(){
grunt.task.run(['connect', 'watch']);
});
grunt.registerTask('build', function(){
grunt.task.run(['jshint', 'uglify']);
});
grunt.registerTask('default', ['demo']);
};