Skip to content

Commit

Permalink
подключение в код plumber, для избегания падений gulp'а
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Ovechkin committed Aug 26, 2014
1 parent 9e02589 commit e7fe8d8
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions gulpfile.js
Expand Up @@ -15,7 +15,9 @@ var gulp = require('gulp'),
gulp.task('images', function () {
watch({glob: 'src/img/**/*'},
function(files) {
files.pipe(imagemin({
files
.pipe(plumber())
.pipe(imagemin({
progressive: true,
svgoPlugins: [{removeViewBox: false}],
use: [pngcrush()]
Expand All @@ -28,7 +30,19 @@ gulp.task('images', function () {
gulp.task('compress', function() {
watch({glob: 'src/js/**/*.js'},
function(files) {
files.pipe(uglify())
files
.pipe(plumber())
.pipe(uglify())
.pipe(gulp.dest('public/js'))
.pipe(reload({stream:true}));
});
});

gulp.task('copy-json', function() {
watch({glob: 'src/js/**/*.json'},
function(files) {
files
.pipe(plumber())
.pipe(gulp.dest('public/js'))
.pipe(reload({stream:true}));
});
Expand All @@ -37,7 +51,9 @@ gulp.task('compress', function() {
gulp.task('minify-css', function() {
watch({glob: 'src/css/**/*.css'},
function(files) {
files.pipe(minifyCSS())
files
.pipe(plumber())
.pipe(minifyCSS())
.pipe(gulp.dest('public/css'))
.pipe(reload({stream:true}));
});
Expand All @@ -46,7 +62,9 @@ gulp.task('minify-css', function() {
gulp.task('stylus', function () {
watch({glob: 'src/css/**/*.styl'},
function(files) {
files.pipe(stylus({compress: true, use: nib()}))
files
.pipe(plumber())
.pipe(stylus({compress: true, use: nib()}))
.pipe(prefix())
.pipe(gulp.dest('public/css'))
.pipe(reload({stream:true}));
Expand All @@ -62,6 +80,6 @@ gulp.task('browser-sync', function() {
});
});

gulp.task('default', ['minify-css', 'stylus', 'images', 'compress', 'browser-sync'], function () {
gulp.task('default', ['minify-css', 'stylus', 'images', 'compress', 'copy-json', 'browser-sync'], function () {
gulp.watch(['views/**/*.jade'], reload);
});

0 comments on commit e7fe8d8

Please sign in to comment.