forked from mathiasbynens/grunt-zopfli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
82 lines (74 loc) · 2.06 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) {
grunt.initConfig({
'clean': {
'tests': ['tmp'],
},
// Configuration to be run and tested
'zopfli': {
'test-1': {
'options': {},
'files': {
'tmp/test-1.js.gz': 'tests/fixtures/jquery.min.js'
}
},
'test-2': {
'options': {
'report': false, // don’t show original and compressed size
'iterations': 50, // min value: 1; (undocumented) max value: 99999999999
'format': 'zlib', // 'gzip', 'zlib', 'deflate'
'splitLast': false // perform block splitting first instead of last
},
'files': {
'tmp/test-2.js.zlib': 'tests/fixtures/benchmark.js'
}
},
'test-3': {
'options': {
'iterations': 25, // min value: 1; (undocumented) max value: 99999999999
'format': 'deflate', // 'gzip', 'zlib', 'deflate'
'splitLast': true // perform block splitting last instead of first
},
'files': {
'tmp/test-3.js.deflate': 'tests/fixtures/benchmark.js'
}
},
'test-4': {
'options': {
'iterations': 25, // min value: 1; (undocumented) max value: 99999999999
'format': 'deflate', // 'gzip', 'zlib', 'deflate'
'splitLast': false // perform block splitting first instead of last
},
'files': {
'tmp/test-4.js.deflate': 'tests/fixtures/benchmark.js'
}
},
'test-5': {
'options': {
'iterations': 10 // min value: 1; (undocumented) max value: 99999999999
},
'files': {
'tmp/test-5-a.js.gz': 'tests/fixtures/benchmark.js',
'tmp/test-5-b.js.gz': 'tests/fixtures/jquery.min.js'
}
},
'test-6': {
'options': {
'iterations': 5, // min value: 1; (undocumented) max value: 99999999999
},
'src': ['tests/fixtures/*'],
'dest': 'tmp/test-6/',
'expand': true,
'ext': '.js.gz'
}
},
// Unit tests
'nodeunit': {
'tests': ['tests/tests.js']
}
});
grunt.loadTasks('tasks');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-nodeunit');
grunt.registerTask('test', ['clean', 'zopfli', 'nodeunit']);
grunt.registerTask('default', ['test']);
};