-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
98 lines (96 loc) · 2 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
// Generated by CoffeeScript 1.7.1
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
browserify: {
dist: {
files: {
'dist/bundle.js': ['src/index.js']
}
}
},
exec: {
clean: {
command: 'rm -rf dist'
},
mv4test: {
command: 'cp dist/bundle.js dev/'
}
},
connect: {
server: {
options: {
base: ["dev"],
hostname: "0.0.0.0"
}
},
options: {
port: 8000,
livereload: 35729
}
},
watch: {
livereload: {
files: ["src/**/*.js"],
tasks: ["browserify", "exec:mv4test"],
options: {
livereload: 35729
}
}
},
karma: {
options: {
frameworks: ['jasmine', 'commonjs'],
files: [
'src/**/*.js',
'test/ut/**/*.js'
],
preprocessors: {
'src/**/*.js': ['commonjs'],
'test/ut/**/*.js': ['commonjs']
},
singleRun: true
},
browsers: {
options: {
browsers: ['Chrome'],
reporters: ['spec']
}
},
coverage: {
options: {
browsers: ['Chrome'],
reporters: ['progress', 'coverage'],
preprocessors: {
'src/**/*.js': ['commonjs', 'coverage'],
'test/ut/**/*.js': ['commonjs']
},
coverageReporter: {
reporters: [
{ type: 'lcov' },
{ type: 'text-summary' }
]
}
}
}
},
});
grunt.loadNpmTasks('grunt-karma')
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-exec');
grunt.loadNpmTasks("grunt-contrib-connect");
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.registerTask('default', [
'browserify',
'exec:mv4test',
"connect",
"watch"
]);
grunt.registerTask('build', [
'browserify',
//todo
]);
grunt.registerTask('ut', [
'karma:browsers'
]);
};