-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
101 lines (95 loc) · 2.49 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
module.exports = function(grunt) {
var gzip = require("gzip-js");
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
dist: {
options: {
process: function(src, filepath) {
return (filepath != 'src/start.js' && filepath != 'src/end.js' ? '// Source: ' + filepath + '\n' : '') + src;
},
},
files: {
'dist/loupe.js': [
'src/start.js',
'src/core/isFunction.js',
'src/core/isArray.js',
'src/core/noop.js',
'src/core/loupe.js',
'src/core/extend.js',
'src/core/cls.js',
'src/core/each.js',
'src/core/selector.js',
'src/core/clear.js',
'src/event/event.js',
'src/color/hexMap.js',
'src/color/random.js',
'src/math/math.js',
'src/math/d.js',
'src/math/color.js',
'src/math/transform.js',
'src/math/numeric.js',
'src/animation/timer.js',
'src/animation/linear.js',
'src/animation/animate.js',
'src/dom/attr.js',
'src/dom/create.js',
'src/dom/style.js',
'src/data/analyze_linear.js',
'src/data/data.js',
'src/data/linear_sync.js',
'src/data/sync.js',
'src/transformations/linear.js',
'src/transformations/transform.js',
'src/engines/engines.js',
'src/engines/svg/shape.js',
'src/engines/svg/text.js',
'src/engines/svg/line.js',
'src/engines/svg/circle.js',
'src/engines/svg/polyline.js',
'src/engines/svg/polygon.js',
'src/engines/svg/rect.js',
'src/engines/svg/path.js',
'src/engines/svg/svg.js',
'src/end.js'
],
'loupe.js': ['dist/loupe.js']
},
},
},
uglify: {
all: {
files: {
"dist/loupe.min.js": [ "dist/loupe.js" ]
},
options: {
compress: { evaluate: false },
beautify: {
ascii_only: true
}
}
}
},
compare_size: {
files: [ "dist/loupe.js", "dist/loupe.min.js" ],
options: {
compress: {
gz: function( contents ) {
return gzip.zip( contents, {} ).length;
}
},
cache: "dist/.sizecache.json"
}
}
});
grunt.registerTask( "commit", function( message ) {
// Always add dist directory
exec( "git add dist && git commit -m " + message, this.async() );
});
grunt.loadNpmTasks("grunt-contrib-qunit");
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-compare-size");
// Default task
grunt.registerTask( "default", [ "concat", "uglify", "compare_size" ] );
};