-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.js
More file actions
117 lines (117 loc) · 2.81 KB
/
Gruntfile.js
File metadata and controls
117 lines (117 loc) · 2.81 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-htmlmin');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-uncss');
grunt.loadNpmTasks('grunt-html'); // does not work for me
grunt.loadNpmTasks('grunt-htmlhint');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default',['uglify','htmlmin','cssmin','uncss','jshint']);
grunt.initConfig({
pkg : require('./package.json'),
concat : {
dist : {
src: '*.js',
dest: 'build/script.js'
}
},
htmllint: {
all: ["wuerfel.html" ],
reporter : 'checkstyle'
},
htmlhint: {
html: {
options: {
'tagname-lowercase' : true,
'attr-lowercase' : true,
'attr-value-double-quotes' : true,
'attr-value-not-empty' : true,
'attr-no-duplication' : true,
'doctype-first' : true,
'tag-pair' : true,
'spec-char-escape' : true,
'id-unique' : true,
'src-not-empty' : true,
'title-require' : true,
'head-script-disabled' : true,
'alt-require' : true,
'doctype-html5' : true,
'id-class-value' : true,
'style-disabled' : true,
'inline-style-disabled' : true,
'space-tab-mixed-disabled' : true,
'id-class-ad-disabled' : true,
'href-abs-or-rel' : true,
'attr-unsafe-chars' : true,
},
src : ["wuerfel.html" ]
},
},
uglify : {
dist : {
options : {
banner : '// <%=grunt.template.today("dd.mm.yyyy") %> by <%= pkg.author %>\n',
sourceMap : true
},
src : '<%= concat.dist.dest %>',
dest : 'build/script.js'
}
},
htmlmin: { // Task
dist: { // Target
options: { // Target options
removeComments: true,
collapseWhitespace: true
},
files: { // Dictionary of files
'build/dice.html': 'dice.html', // 'destination': 'source'
}
}
},
cssmin: {
dist: {
files: [{
expand: true,
src: ['*.css' ],
dest: 'build',
}]
}
},
uncss:{
dist: {
files: {
'build/style.css' : [ 'dice.html','verdoppler.html','wuerfel.html' ]
}
}
},
jshint:{
dist: {
files: {
'build/backgammon_machine.js' : 'backgammon_machine.js'
},
options : {
reporter : require('jshint-stylish'),
unused : true
}
}
},
watch: {
options: {
dateFormat: function(time) {
grunt.log.writeln('The watch finished in ' + time + 'ms at ' + (new Date()).toString());
grunt.log.writeln('Waiting for more changes...');
},
},
scripts: {
files: '*.js',
tasks: 'jshint',
},
stylesheets : {
files: 'style.css',
tasks: 'uncss',
}
}
});
};