-
Notifications
You must be signed in to change notification settings - Fork 33
/
Gruntfile.js
56 lines (51 loc) · 1.58 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
module.exports = function(grunt) {
"use strict";
var pkg = grunt.file.readJSON('bower.json');
grunt.initConfig({
pkg: pkg,
uglify: {
options: {
banner: '/* <%= pkg.name %> <%= pkg.version %> <%= pkg.license %>\n' +
' <%= pkg.homepage %>\n' +
' ' + pkg.authors.join('\n ') + ' */\n'
},
build: {
expand: true,
cwd: 'dist',
src: ['**/*.js', '!**/*.min.js'],
ext: '.min.js',
extDot: 'last',
dest: 'dist'
}
},
jshint: {
options: {
bitwise: true,
curly: true,
eqeqeq: true,
forin: true,
globals: {
L: false
},
latedef: 'nofunc',
undef: true,
unused: true
},
all: ['dist/**/*.js', '!dist/**/*.min.js']
},
shell: {
test: {
command: 'node_modules/.bin/mocha tests/bootstrap.js tests --timeout 10000',
},
tav: {
command: 'node_modules/.bin/tav',
},
},
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-shell');
grunt.registerTask('test-all', ['shell:tav']);
grunt.registerTask('test', ['shell:test']);
grunt.registerTask('default', ['jshint', 'test-all', 'uglify']);
};