Created
March 25, 2015 07:12
-
-
Save barretlee/2445d987183bee2acbf9 to your computer and use it in GitHub Desktop.
gulpfile test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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