Exemplo n.º 1
0
gulp.task('sounds', function() {
  var n = notifier('sounds');

  return gulp
         .src('src/sounds/**/*')
         .pipe(gulp.dest('dist/sounds'))
         .on('end', n.end);
});
Exemplo n.º 2
0
gulp.task('html', function() {
  var n = notifier('html');

  return gulp
         .src('src/index.html')
         .pipe(env === 'production' ? minifyHtml() : gutil.noop())
         .pipe(gulp.dest('dist'))
         .on('end', n.end);
});
Exemplo n.º 3
0
gulp.task('styles', function() {
  var n = notifier('styles');

  return gulp.src('src/main.css')
         .pipe(env === 'production' ? minifyCss() : gutil.noop())
         .pipe(autoprefixer())
         .pipe(rename('bundle.css'))
         .pipe(gulp.dest('dist'))
         .on('end', n.end);
});
Exemplo n.º 4
0
  return function() {
    var n = notifier('browserify');

    return bundler
           .bundle()
           .on('error', n.error)
           .pipe(source('bundle.js'))
           .pipe(env === 'production' ? buffer() : gutil.noop())
           .pipe(env === 'production' ? uglify() : gutil.noop())
           .pipe(gulp.dest('dist'))
           .on('end', n.end);
  };
Exemplo n.º 5
0
gulp.task('images', function() {
  var n = notifier('images');

  var player = gulp
               .src('src/images/player.png')
               .pipe(rename('player-2.png'))
               .pipe(gm(function(gmfile) {
                 return gmfile.fill('rgba(0, 0, 0, 1)').opaque('rgba(255, 255, 255, 1)');
               }));

  return merge(player, gulp.src('src/images/**/*'))
         .pipe(gm(function(gmfile) {
           return gmfile.sample('200%');
         }))
         .on('error', n.error)
         .pipe(gulp.dest('dist/images'))
         .on('end', n.end);
});
Exemplo n.º 6
0
function handleError(err) {
  notify(err.toString());
  this.emit('end');
}