Skip to content

Instantly share code, notes, and snippets.

@barretlee
Created March 25, 2015 07:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barretlee/2445d987183bee2acbf9 to your computer and use it in GitHub Desktop.
Save barretlee/2445d987183bee2acbf9 to your computer and use it in GitHub Desktop.
gulpfile test
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var minicss = require('gulp-minify-css');
var rename = require("gulp-rename");
var del = require('del');
gulp.task('clean', function(cb) {
del(['build'], cb);
});
gulp.task('css', function(){
gulp.src('src/**/*.css')
.pipe(gulp.dest('build'))
.pipe(minicss())
.pipe(rename({
suffix:"-min"
}))
.pipe(gulp.dest('build'));
});
gulp.task('js', function(){
gulp.src('src/**/*.js')
.pipe(gulp.dest('build'))
.pipe(uglify())
.pipe(rename({
suffix:"-min"
}))
.pipe(gulp.dest('build'));
});
gulp.task('default', ['clean'], function(){
gulp.start('css', 'js');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment