-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
79 lines (76 loc) · 1.52 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
module.exports = function(grunt){
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify:{
options:{
compress:true
},
reduce_one: {
src: 'src/js/index.js',
dest: 'tmp/js/index.js'
},
},
uncss: {
options:{
ignore: ['.badge', '.badge-info', '.badge-warning', '.btn-danger']
},
reduce_one: {
files: {
'tmp/css/style_uncss.css': ['src/ClientWebSocketTester.html']
}
}
},
copy:{
reduce_one:{
expand: true,
cwd: 'src/',
src: ['ClientWebSocketTester.html'],
dest: 'tmp/'
}
},
cssmin:{
options:{
level: {
1: {
specialComments: 0
}
}
},
reduce_two: {
files: {
'tmp/css/style.css': ['tmp/css/style_uncss.css']
}
}
},
processhtml:{
options: {
},
reduce_three: {
files: {
'tmp/ClientWebSocketTester.html' : ['tmp/ClientWebSocketTester.html']
}
}
},
htmlmin:{
options:{
removeComments: true,
collapseWhitespace: true
},
build: {
files: {
'build/ClientWebSocketTester.html' : 'tmp/ClientWebSocketTester.html'
}
}
}
});
// Load modules
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-uncss');
grunt.loadNpmTasks('grunt-processhtml');
grunt.loadNpmTasks('grunt-contrib-htmlmin');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.file.mkdir('tmp');
grunt.file.mkdir('build');
grunt.registerTask('default', ['uglify', 'uncss', 'copy', 'cssmin', 'processhtml', 'htmlmin']);
}