|
166 | 166 | }
|
167 | 167 | },
|
168 | 168 |
|
| 169 | + htmlmin: { |
| 170 | + dist: { |
| 171 | + options: { |
| 172 | + minifyJS: true, |
| 173 | + removeComments: true, |
| 174 | + collapseWhitespace: true |
| 175 | + }, |
| 176 | + files: { |
| 177 | + 'frontend/build/standalone-min.html' : 'frontend/build/standalone.html', |
| 178 | + 'clusterFrontend/build/cluster-min.html' : 'clusterFrontend/build/cluster.html', |
| 179 | + 'frontend/build/documentation-min.html' : 'frontend/html/documentation.html' |
| 180 | + } |
| 181 | + } |
| 182 | + }, |
| 183 | + |
| 184 | + compress: { |
| 185 | + main: { |
| 186 | + options: { |
| 187 | + mode: 'gzip' |
| 188 | + }, |
| 189 | + files: [{ |
| 190 | + expand: true, |
| 191 | + src: ['frontend/build/*min*.html'], |
| 192 | + dest: '.', |
| 193 | + ext: '.html.gz' |
| 194 | + }] |
| 195 | + }, |
| 196 | + standaloneJS: { |
| 197 | + options: { |
| 198 | + mode: 'gzip' |
| 199 | + }, |
| 200 | + files: [{ |
| 201 | + expand: true, |
| 202 | + src: ['frontend/build/app.js'], |
| 203 | + dest: '.', |
| 204 | + ext: '.js.gz' |
| 205 | + }] |
| 206 | + }, |
| 207 | + sharedJS: { |
| 208 | + options: { |
| 209 | + mode: 'gzip' |
| 210 | + }, |
| 211 | + files: [{ |
| 212 | + expand: true, |
| 213 | + src: ['build/sharedLibs.js'], |
| 214 | + dest: '.', |
| 215 | + ext: '.js.gz' |
| 216 | + }] |
| 217 | + }, |
| 218 | + docuJS: { |
| 219 | + options: { |
| 220 | + mode: 'gzip' |
| 221 | + }, |
| 222 | + files: [{ |
| 223 | + expand: true, |
| 224 | + src: ['build/documentation.js'], |
| 225 | + dest: '.', |
| 226 | + ext: '.js.gz' |
| 227 | + }] |
| 228 | + }, |
| 229 | + docuHTML: { |
| 230 | + options: { |
| 231 | + mode: 'gzip' |
| 232 | + }, |
| 233 | + files: [{ |
| 234 | + expand: true, |
| 235 | + src: ['build/documentation-min.html'], |
| 236 | + dest: '.', |
| 237 | + ext: '.html.gz' |
| 238 | + }] |
| 239 | + } |
| 240 | + }, |
| 241 | + |
169 | 242 | cssmin: {
|
170 | 243 | dist: {
|
171 | 244 | options: {
|
|
337 | 410 | '<%=project.standalone.js %>'
|
338 | 411 | ]
|
339 | 412 | },
|
340 |
| - |
| 413 | + |
341 | 414 | uglify: {
|
342 | 415 | dist: {
|
343 | 416 | files: {
|
| 417 | + /*'frontend/build/templates-minified.js': ['frontend/js/templates/*.ejs']*/ |
344 | 418 | 'frontend/build/app.min.js': 'frontend/build/app.js'
|
345 | 419 | }
|
346 | 420 | }
|
|
352 | 426 | 'frontend/scss/{,*/}*.{scss,sass}',
|
353 | 427 | 'clusterFrontend/scss/{,*/}*.{scss,sass}',
|
354 | 428 | ],
|
355 |
| -
A3E2
tasks: ['sass:dev', 'cssmin'] |
| 429 | + tasks: ['sass:dev', 'cssmin', 'gzip'] |
356 | 430 | },
|
357 | 431 | imagemin: {
|
358 | 432 | files: [
|
|
385 | 459 | ],
|
386 | 460 | tasks: [
|
387 | 461 | 'concat_in_order:htmlCluster',
|
388 |
| - 'concat_in_order:htmlStandalone' |
| 462 | + 'concat_in_order:htmlStandalone', |
| 463 | + 'htmlmin' |
389 | 464 | ]
|
390 | 465 | }
|
391 | 466 | }
|
|
394 | 469 | grunt.loadNpmTasks("grunt-sass");
|
395 | 470 | grunt.loadNpmTasks("grunt-contrib-imagemin");
|
396 | 471 | grunt.loadNpmTasks('grunt-contrib-cssmin');
|
| 472 | + grunt.loadNpmTasks('grunt-contrib-compress'); |
397 | 473 | grunt.loadNpmTasks("grunt-contrib-concat");
|
| 474 | + grunt.loadNpmTasks('grunt-contrib-htmlmin') |
| 475 | + grunt.loadNpmTasks('grunt-contrib-uglify') |
398 | 476 |
|
399 | 477 | require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
|
400 | 478 | grunt.loadNpmTasks('grunt-text-replace');
|
|
404 | 482 | 'jshint:default',
|
405 | 483 | 'replace',
|
406 | 484 | 'imagemin',
|
407 |
| - 'cssmin', |
408 | 485 | 'concat',
|
409 | 486 | 'concat_in_order:sharedLibs',
|
410 | 487 | 'concat_in_order:default',
|
411 | 488 | 'concat_in_order:jsCluster',
|
412 | 489 | 'concat_in_order:htmlCluster',
|
413 | 490 | 'concat_in_order:htmlStandalone',
|
| 491 | + 'cssmin', |
| 492 | + 'htmlmin', |
| 493 | + 'compress', |
414 | 494 | 'watch'
|
415 | 495 | ]);
|
416 | 496 |
|
|
0 commit comments