forked from titon/probe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
44 lines (39 loc) · 1.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
module.exports = function(grunt) {
function createBanner() {
return "/*!\n" +
" * Titon Probe v<%= pkg.version %>\n" +
" * <%= pkg.copyright %> - <%= pkg.homepage %>\n" +
" * <%= pkg.licenses[0].type %> - <%= pkg.licenses[0].url %>\n" +
" */\n";
}
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
options: {
browser: true,
loopfunc: true,
validthis: true
},
build: {
src: ['src/probe.js']
}
},
uglify: {
options: {
report: 'min',
banner: createBanner()
},
build: {
files: {
'dist/probe.min.js': 'src/probe.js'
}
}
}
});
// Load plugins
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
// Register tasks
grunt.registerTask('validate', ['jshint']);
grunt.registerTask('default', ['jshint', 'uglify']);
};