-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
82 lines (73 loc) · 1.6 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
70
71
72
73
74
75
76
77
78
79
80
81
82
module.exports = function(grunt) {
'use strict';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
banner: '/*! <%= pkg.name %>.js <%= grunt.template.today("dd/mm/yyyy") %> */\n',
preserveComments: false,
report: 'gzip',
screwIE8: true,
sourceMap: true,
sourceMapName: 'dist/<%= pkg.name %>.map',
strict: true,
compress: {
drop_console: true,
global_defs: {
'this.options.debug': false
}
}
},
dist: {
src: 'kafe.real.js',
dest: 'dist/<%= pkg.name %>.min.js'
}
},
clean: {
release: ['dist/*']
},
watch: {
scripts: {
files: ['kafe.real.js', '.jscsrc', 'Gruntfile.js'],
tasks: ['jscs', 'jshint']
}
},
jscs: {
options: {
config: '.jscsrc',
verbose: true,
force: true,
reporter: require('jscs-stylish').path
},
core: {
src: ['kafe.real.js', 'Gruntfile.js']
}
},
jshint: {
files: ['kafe.real.js'],
options: {
eqeqeq: true,
loopfunc: true,
maxdepth: 1,
nonbsp: true,
notypeof: true,
plusplus: true,
shadow: true,
unused: true,
globals: {
jQuery: true
},
'-W040': true // Possible strict violation.
}
}
});
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-jscs');
grunt.registerTask('clear', ['clean']);
grunt.registerTask('build', ['uglify']);
grunt.registerTask('verify', ['jscs','jshint']);
grunt.registerTask('dev', ['watch']);
};