-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathgruntfile.js
259 lines (253 loc) · 9.81 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
module.exports = function(grunt) {
this.uglifyOptions = {
dead_code: true,
conditionals: true,
evaluate: true,
unused: true,
join_vars: true,
drop_console: true,
drop_debugger: true,
comparisons: true,
booleans: true,
loops: true,
if_return: true
};
grunt.initConfig({
cssmin: {
full: {
files: {
"build/dc-tableview.css": [
"node_modules/datatables.net-dt/css/jquery.dataTables.css",
"node_modules/datatables.net-rowgroup-dt/css/rowGroup.dataTables.css",
"node_modules/datatables.net-fixedheader-dt/css/fixedHeader.dataTables.css",
"node_modules/datatables.net-colreorder-dt/css/colReorder.dataTables.css",
"node_modules/datatables.net-buttons-dt/css/buttons.dataTables.css",
"node_modules/datatables.net-scroller-dt/css/scroller.dataTables.css",
"node_modules/datatables.net-select-dt/css/select.dataTables.css",
"node_modules/datatables.net-responsive-dt/css/responsive.dataTables.css",
"src/main.css"
]
}
},
full_bs: {
files: {
"build/dc-tableview-bs.css": [
"node_modules/datatables.net-bs4/css/dataTables.bootstrap4.css",
"node_modules/datatables.net-rowgroup-bs4/css/rowGroup.bootstrap4.css",
"node_modules/datatables.net-fixedheader-bs4/css/fixedHeader.bootstrap4.css",
"node_modules/datatables.net-colreorder-bs4/css/colReorder.bootstrap4.css",
"node_modules/datatables.net-buttons-bs4/css/buttons.bootstrap4.css",
"node_modules/datatables.net-scroller-bs4/css/scroller.bootstrap4.css",
"node_modules/datatables.net-select-bs4/css/select.bootstrap4.css",
"node_modules/datatables.net-responsive-bs4/css/responsive.bootstrap4.css",
"src/main.css"
]
}
},
light: {
files: {
"build/dc-tableview-light.css": [
"node_modules/datatables.net-dt/css/jquery.dataTables.css",
"node_modules/datatables.net-rowgroup-dt/css/rowGroup.dataTables.css",
"node_modules/datatables.net-fixedheader-dt/css/fixedHeader.dataTables.css",
"node_modules/datatables.net-responsive-dt/responsive.dataTables.css",
"src/main.css"
]
}
},
light_bs: {
files: {
"build/dc-tableview-light-bs.css": [
"node_modules/datatables.net-bs4/css/dataTables.bootstrap4.css",
"node_modules/datatables.net-rowgroup-bs4/css/rowGroup.bootstrap4.css",
"node_modules/datatables.net-fixedheader-bs4/css/fixedHeader.bootstrap4.css",
"node_modules/datatables.net-responsive-bs4/css/responsive.bootstrap4.css",
"src/main.css"
]
}
}
},
concat: {
full: {
src: [
"node_modules/datatables.net-buttons/async/async.js",
"node_modules/datatables.net/js/jquery.dataTables.js",
"node_modules/datatables.net-rowgroup/js/dataTables.rowGroup.js",
"node_modules/datatables.net-fixedheader/js/dataTables.fixedHeader.js",
"node_modules/datatables.net-colreorder/js/dataTables.colReorder.js",
"node_modules/datatables.net-scroller/js/dataTables.scroller.js",
"node_modules/datatables.net-select/js/dataTables.select.js",
"node_modules/datatables.net-responsive/js/dataTables.responsive.js",
"node_modules/datatables.net-responsive-dt/js/responsive.dataTables.js",
"node_modules/datatables.net-scroller-dt/js/scroller.dataTables.js",
"node_modules/datatables.net-select-dt/js/select.dataTables.js",
"node_modules/datatables.net-buttons/js/dataTables.buttons.js",
"node_modules/datatables.net-buttons/js/buttons.html5.js",
"node_modules/datatables.net-buttons/js/buttons.print.js",
"node_modules/jszip/dist/jszip.js",
"node_modules/pdfmake/build/pdfmake.js",
"node_modules/pdfmake/build/vfs_fonts.js",
"src/main.js"
],
dest: "build/dc-tableview.js"
},
full_bs: {
src: [
"node_modules/datatables.net/js/jquery.dataTables.js",
"node_modules/datatables.net-bs4/js/dataTables.bootstrap4.js",
"node_modules/datatables.net-buttons/async/async.js",
"node_modules/datatables.net-rowgroup/js/dataTables.rowGroup.js",
"node_modules/datatables.net-scroller/js/dataTables.scroller.js",
"node_modules/datatables.net-select/js/dataTables.select.js",
"node_modules/datatables.net-responsive/js/dataTables.responsive.js",
"node_modules/datatables.net-rowgroup-bs4/js/rowGroup.bootstrap4.js",
"node_modules/datatables.net-fixedheader/js/dataTables.fixedHeader.js",
"node_modules/datatables.net-fixedheader-bs4/js/fixedHeader.bootstrap4.js",
"node_modules/datatables.net-colreorder/js/dataTables.colReorder.js",
"node_modules/datatables.net-colreorder-bs4/js/colReorder.bootstrap4.js",
"node_modules/datatables.net-scroller-bs4/js/scroller.bootstrap4.js",
"node_modules/datatables.net-select-bs4/js/select.bootstrap4.js",
"node_modules/datatables.net-responsive-bs4/js/responsive.bootstrap4.js",
"node_modules/datatables.net-buttons/js/dataTables.buttons.js",
"node_modules/datatables.net-buttons-bs4/js/buttons.bootstrap4.js",
"node_modules/datatables.net-buttons/js/buttons.html5.js",
"node_modules/datatables.net-buttons/js/buttons.print.js",
"node_modules/jszip/dist/jszip.js",
"node_modules/pdfmake/build/pdfmake.js",
"node_modules/pdfmake/build/vfs_fonts.js",
"src/main.js"
],
dest: "build/dc-tableview-bs.js"
},
light: {
src: [
"node_modules/datatables.net/js/jquery.dataTables.js",
"node_modules/datatables.net-rowgroup/js/dataTables.rowGroup.js",
"node_modules/datatables.net-fixedheader/js/dataTables.fixedHeader.js",
"node_modules/datatables.net-responsive/js/dataTables.responsive.js",
"node_modules/datatables.net-responsive-dt/js/responsive.dataTables.js",
"src/main.js"
],
dest: "build/dc-tableview-light.js"
},
light_bs: {
src: [
"node_modules/datatables.net/js/jquery.dataTables.js",
"node_modules/datatables.net-responsive/js/dataTables.responsive.js",
"node_modules/datatables.net-responsive-bs4/js/responsive.bootstrap4.js",
"node_modules/datatables.net-bs4/js/dataTables.bootstrap4.js",
"node_modules/datatables.net-rowgroup-bs4/js/rowGroup.bootstrap4.js",
"node_modules/datatables.net-fixedheader-bs4/js/fixedHeader.bootstrap4.js",
"node_modules/datatables.net-rowgroup/js/dataTables.rowGroup.js",
"node_modules/datatables.net-fixedheader/js/dataTables.fixedHeader.js",
"src/main.js"
],
dest: "build/dc-tableview-light-bs.js"
}
},
umd: {
full: {
options: {
src: "build/dc-tableview.js",
dest: "build/dc-tableview.js",
globalAlias: "tableview",
deps: {
"default": [
{ "dc": "dc" },
{ "jquery": "$" }
],
global: ["dc", "$"]
}
}
},
full_bs: {
options: {
src: "build/dc-tableview-bs.js",
dest: "build/dc-tableview-bs.js",
globalAlias: "tableview",
deps: {
"default": [
{ "bootstrap": "bootstrap" },
{ "dc": "dc" },
{ "jquery": "$" }
],
global: ["bootstrap", "dc", "$"]
}
}
},
light: {
options: {
src: "build/dc-tableview-light.js",
dest: "build/dc-tableview-light.js",
globalAlias: "tableview",
deps: {
"default": [
{ "dc": "dc" },
{ "jquery": "$" }
],
global: ["dc", "$"]
}
}
},
light_bs: {
options: {
src: "build/dc-tableview-light-bs.js",
dest: "build/dc-tableview-light-bs.js",
globalAlias: "tableview",
deps: {
"default": [
{ "bootstrap": "bootstrap" },
{ "dc": "dc" },
{ "jquery": "$" }
],
global: ["bootstrap", "dc", "$"]
}
}
}
},
uglify: {
full: {
files: [{
"build/dc-tableview.min.js": ["build/dc-tableview.js"]
}],
compress: this.uglifyOptions
},
full_bs: {
files: [{
"build/dc-tableview-bs.min.js": ["build/dc-tableview-bs.js"]
}],
compress: this.uglifyOptions
},
light: {
files: [{
"build/dc-tableview-light.min.js": ["build/dc-tableview-light.js"]
}],
compress: this.uglifyOptions
},
light_bs: {
files: [{
"build/dc-tableview-light-bs.min.js": ["build/dc-tableview-light-bs.js"]
}],
compress: this.uglifyOptions
}
},
_clean: {
build: {
src: ["build/"]
}
}
});
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-contrib-cssmin");
grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-umd");
grunt.renameTask("clean", "_clean");
var cleanTask = ["_clean"];
var buildTask = ["_clean", "cssmin", "concat", "umd"];
var packageTask = ["_clean", "cssmin", "concat", "umd", "uglify"];
grunt.registerTask("default", buildTask);
grunt.registerTask("clean", cleanTask);
grunt.registerTask("build", buildTask);
grunt.registerTask("package", packageTask);
};