Added task for compressing images - fix #45

Added task for compressing images - fix #45
This commit is contained in:
Pablo Terradillos 2014-03-19 06:44:25 -03:00
parent 0cafc89ca4
commit aea9dd4538

View File

@ -27,11 +27,17 @@ gulp.task('usemin', ['templates', 'enable-production'], function() {
.pipe(gulp.dest('dist')); .pipe(gulp.dest('dist'));
}); });
gulp.task('imagemin', ['build', 'copy'], function() {
return gulp.src(['app/img/**/*', '!app/img/screenshot*', '!app/img/*.wav'])
.pipe($.imagemin())
.pipe(gulp.dest('dist/img'));
});
gulp.task('copy', function() { gulp.task('copy', function() {
return es.concat( return es.concat(
gulp.src(['app/favicon.ico', 'app/favicon_unread.ico', 'app/manifest.webapp', 'app/manifest.json', 'app/**/*worker.js']) gulp.src(['app/favicon.ico', 'app/favicon_unread.ico', 'app/manifest.webapp', 'app/manifest.json', 'app/**/*worker.js'])
.pipe(gulp.dest('dist')), .pipe(gulp.dest('dist')),
gulp.src(['app/img/**/*', '!app/img/screenshot*']) gulp.src(['app/img/**/*.wav'])
.pipe(gulp.dest('dist/img')), .pipe(gulp.dest('dist/img')),
gulp.src('app/vendor/console-polyfill/console-polyfill.js') gulp.src('app/vendor/console-polyfill/console-polyfill.js')
.pipe(gulp.dest('dist/vendor/console-polyfill')), .pipe(gulp.dest('dist/vendor/console-polyfill')),
@ -50,7 +56,7 @@ gulp.task('copy', function() {
); );
}); });
gulp.task('compress-dist', ['add-csp'], function() { gulp.task('compress-dist', ['add-csp', 'imagemin'], function() {
return gulp.src('dist/**/*') return gulp.src('dist/**/*')
.pipe($.zip('webogram_v' + pj.version + '.zip')) .pipe($.zip('webogram_v' + pj.version + '.zip'))
.pipe(gulp.dest('releases')); .pipe(gulp.dest('releases'));
@ -132,7 +138,7 @@ gulp.task('bump', ['update-version-manifests', 'update-version-settings', 'updat
gulp.task('build', ['templates', 'usemin', 'copy'], function () { gulp.task('build', ['templates', 'usemin', 'copy'], function () {
gulp.start('disable-production'); gulp.start('disable-production');
}); });
gulp.task('package', ['cleanup-dist']); gulp.task('package', ['cleanup-dist', 'imagemin']);
gulp.task('publish', ['build'], function() { gulp.task('publish', ['build'], function() {
gulp.start('add-appcache-manifest'); gulp.start('add-appcache-manifest');