Skip to content

Commit

Permalink
use defined paths in sample
Browse files Browse the repository at this point in the history
  • Loading branch information
yocontra committed Jan 31, 2014
1 parent 6e745c5 commit bee6f05
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,30 @@ var gulp = require('gulp');
var uglify = require('gulp-uglify');
var imagemin = require('gulp-imagemin');

var paths = {
scripts: ['client/js/**/*.js', '!client/js/vendor/**'],
images: 'client/img/**/*'
};

gulp.task('scripts', function() {
// Minify and copy all JavaScript (except vendor scripts)
return gulp.src(['client/js/**/*.js', '!client/js/vendor/**'])
return gulp.src(paths.scripts)
.pipe(uglify())
.pipe(gulp.dest('build/js'));
});

// Copy all static images
gulp.task('images', function() {
return gulp.src('client/img/**/*')
return gulp.src(paths.images)
// Pass in options to the task
.pipe(imagemin({optimizationLevel: 5}))
.pipe(gulp.dest('build/img'));
});

// Rerun the task when a file changes
gulp.task('watch', function () {
gulp.watch('client/js/**/*', ['scripts']);
gulp.watch('client/img/**/*', ['images']);
gulp.watch(paths.scripts, ['scripts']);
gulp.watch(paths.images, ['images']);
});

// The default task (called when you run `gulp` from cli)
Expand Down

0 comments on commit bee6f05

Please sign in to comment.