-
Notifications
You must be signed in to change notification settings - Fork 6
/
Gruntfile.js
135 lines (126 loc) · 3.93 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
full: {
src: [
'src/jsketch.js',
'src/jsketch.svg.js',
'src/sketchable.utils.js',
'src/sketchable.js',
'src/sketchable.memento.js',
'src/sketchable.animate.js',
'src/sketchable.serializer.js',
'src/sketchable.svg.js',
],
dest: 'dist/sketchable.full.js'
},
jqFull: {
src: [
'src/jsketch.js',
'src/jsketch.svg.js',
'src/jquery.sketchable.js',
'src/jquery.sketchable.memento.js',
'src/jquery.sketchable.animate.js',
'src/jquery.sketchable.serializer.js',
'src/jquery.sketchable.svg.js',
],
dest: 'dist/jquery.sketchable.full.js'
}
},
uglify: {
jsketch: {
files: {
'dist/jsketch.min.js': [ 'src/jsketch.js' ]
}
},
jsketchSvg: {
files: {
'dist/jsketch.svg.min.js': [ 'src/jsketch.svg.js' ]
}
},
sketchable: {
files: {
'dist/sketchable.min.js': [ 'src/sketchable.js' ]
}
},
memento: {
files: {
'dist/sketchable.memento.min.js': [ 'src/sketchable.memento.js' ]
}
},
animate: {
files: {
'dist/sketchable.animate.min.js': [ 'src/sketchable.animate.js' ]
}
},
serializer: {
files: {
'dist/sketchable.serializer.min.js': [ 'src/sketchable.serializer.js' ]
}
},
svg: {
files: {
'dist/sketchable.svg.min.js': [ 'src/sketchable.svg.js' ]
}
},
full: {
options: {
banner: '/*! <%= pkg.description %> (all in one) | v<%= pkg.version %> | <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
files: {
'dist/sketchable.full.min.js': [ '<%= concat.full.dest %>' ]
}
},
jqSketchable: {
files: {
'dist/jquery.sketchable.min.js': [ 'src/jquery.sketchable.js' ]
}
},
jqMemento: {
files: {
'dist/jquery.sketchable.memento.min.js': [ 'src/jquery.sketchable.memento.js' ]
}
},
jqAnimate: {
files: {
'dist/jquery.sketchable.animate.min.js': [ 'src/jquery.sketchable.animate.js' ]
}
},
jqSerializer: {
files: {
'dist/jquery.sketchable.serializer.min.js': [ 'src/jquery.sketchable.serializer.js' ]
}
},
jqSvg: {
files: {
'dist/jquery.sketchable.svg.min.js': [ 'src/jquery.sketchable.svg.js' ]
}
},
jqFull: {
options: {
banner: '/*! <%= pkg.description %> (all in one) | v<%= pkg.version %> | <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
files: {
'dist/jquery.sketchable.full.min.js': [ '<%= concat.jqFull.dest %>' ]
}
}
},
clean: {
js: [
'dist/*.js', '!dist/*.min.js'
]
},
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.registerTask('full', [ 'concat:full', 'uglify:full', 'concat:jqFull', 'uglify:jqFull', 'clean' ]);
grunt.registerTask('jsketch', [ 'uglify:jsketch', 'clean' ]);
grunt.registerTask('sketchable', [ 'uglify:sketchable', 'uglify:jqSketchable', 'clean' ]);
grunt.registerTask('memento', [ 'uglify:memento', 'uglify:jqMemento', 'clean' ]);
grunt.registerTask('animate', [ 'uglify:animate', 'uglify:jqAnimate', 'clean' ]);
grunt.registerTask('serializer', [ 'uglify:serializer', 'uglify:jqSerializer', 'clean' ]);
grunt.registerTask('svg', [ 'uglify:jsketchSvg', 'uglify:svg', 'uglify:jqSvg', 'clean' ]);
grunt.registerTask('default', [ 'full', 'jsketch', 'sketchable', 'memento', 'animate', 'serializer', 'svg' ]);
};