-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.js
More file actions
60 lines (58 loc) · 1.87 KB
/
Gruntfile.js
File metadata and controls
60 lines (58 loc) · 1.87 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
/*global module:false*/
module.exports = function (grunt) {
"use strict";
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
options : {
jshintrc : '.jshintrc'
},
all : ['xmlQuery.js', 'Gruntfile.js']
},
uglify: {
options: {
banner: '/*! <%= pkg.name %>.js <%= pkg.version %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
build: {
src: '<%= pkg.name %>.js',
dest: '<%= pkg.name %>.min.js'
}
},
jasmine: {
options: {
specs: 'test/spec/*.spec.js'
},
uncompressed: {
src: 'xmlQuery.js'
},
coverage: {
src: 'xmlQuery.js',
options: {
template : require('grunt-template-jasmine-istanbul'),
templateOptions: {
coverage: 'reports/coverage.json',
report: {
type: 'text',
options: {
dir: 'reports/coverage'
}
}
}
}
},
compressed: {
src: 'xmlQuery.min.js'
}
},
clean : {
reports : ['reports'],
minified: ['<%= pkg.name %>.min.js']
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.registerTask('test', ['clean', 'uglify', 'jshint', 'jasmine:uncompressed', 'jasmine:compressed', 'jasmine:coverage']);
grunt.registerTask('default', ['test']);
};