-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathGruntfile.js
69 lines (56 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
63
64
65
66
67
68
69
module.exports = function(grunt) {
'use strict';
// Helper Methods ____________________________________________________________
function generateBanner() {
var banner = '';
banner += '/**\n';
banner += ' * <%= pkg.name %>\n';
banner += ' * <%= pkg.description %>\n';
banner += ' * \n';
banner += ' * @author <%= pkg.author %>\n';
banner += ' * @version <%= pkg.version %>\n';
banner += ' * @license <%= pkg.license %>\n';
banner += ' */\n';
return banner;
}
// Initialization ____________________________________________________________
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
all: ['tattletale.js'],
options: {
'jshintrc': '.jshintrc'
}
},
mocha: {
options: {
reporter: 'Spec',
run: true
},
desktop: {
src: ['test/tattletale-test.html']
}
},
uglify: {
options: {
banner: generateBanner(),
preserveComments: 'some',
report: 'gzip'
},
my_target: {
files: {
'tattletale.min.js': 'tattletale.js'
}
}
}
});
// Plug-In Loading ___________________________________________________________
// Load the plugins that provide the tasks we specified in package.json
var npm_packages = [
'grunt-contrib-jshint',
'grunt-contrib-uglify',
'grunt-mocha'
].forEach(grunt.loadNpmTasks);
// Tasks _____________________________________________________________________
grunt.registerTask('default', ['jshint', 'mocha', 'uglify']);
};