-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgruntfile.js
More file actions
98 lines (82 loc) · 2.41 KB
/
gruntfile.js
File metadata and controls
98 lines (82 loc) · 2.41 KB
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
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
filename: '<%= pkg.name %>.<%= pkg.version %>',
timestamp: new Date().toUTCString(),
banner: '/*! <%= filename %>.js | <%= pkg.url %> | <%= pkg.license %>\n' +
'* <%= pkg.author %> | <%= pkg.contact %>\n' +
'* Built on <%= timestamp %> */\n',
s: 'src/',
t: 'test/',
concat: {
options: {
banner: '<%= banner %>' +
'\n;(function() {\n\n"use strict";\n\n',
footer: '\n})();\n'
},
dist: {
src: ['<%=s%>lib/cuts-the-mustard.js', '<%=s%>_mustard-cut.js', '<%=s%>lib/*.js',
'<%= s %>_jsdoc.js', '<%=s%>main.js', '<%=s%>footer.js'],
dest: 'dist/<%= filename %>.js'
}
},
uglify: {
options: {
banner: '<%= banner %>'
},
dist: {
files: {
'dist/<%= filename %>.min.js': ['<%= concat.dist.dest %>']
}
}
},
jasmine: {
src: ['<%=s%>lib/*.js', '<%=s%>main.js', '<%=s%>footer.js'],
options: {
specs: '<%=t%>/*.js',
template: require('grunt-template-jasmine-istanbul'),
templateOptions: {
coverage: 'coverage/coverage.json',
report: [
{ type: 'lcov', options: { dir: 'coverage' }},
{ type: 'html', options: { dir: 'coverage/html' }},
{ type: 'text-summary' }
],
thresholds: {
lines: 40, // 75
statements: 40, // 75
branches: 35, // 75
functions: 50 // 75
}
}
}
},
jshint: {
files: ['gruntfile.js', '<%=s%>**/*.js', '<%=t%>**/*.js'],
options: {
browser: true,
globals: {
predef: ['jQuery']
}
}
},
watch: {
files: ['<%= jshint.files %>'],
tasks: ['jshint', 'jasmine']
},
coveralls: {
options: {
force: true
},
src: 'coverage/lcov.info'
}
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-coveralls');
grunt.registerTask('test', ['jshint', 'jasmine', 'coveralls']);
grunt.registerTask('build', ['jshint', 'jasmine', 'concat', 'uglify']);
};