Created
November 24, 2014 16:47
-
-
Save megurock/894e4d0b84aa0dd71e59 to your computer and use it in GitHub Desktop.
will be updated.
This file contains 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
// plugins | |
var gulp = require('gulp'); | |
var del = require('del'); | |
var webserver = require('gulp-webserver'); | |
var sass = require('gulp-sass'); | |
var pleeease = require('gulp-pleeease'); | |
var changed = require('gulp-changed'); | |
var usemin = require('gulp-usemin'); | |
var uglify = require('gulp-uglify'); | |
var minifyHtml = require('gulp-minify-html'); | |
var minifyCss = require('gulp-minify-css'); | |
//var rev = require('gulp-rev'); | |
/** | |
* tasks | |
*/ | |
gulp.task('webserver', function() { | |
gulp.src('./src').pipe(webserver({ | |
host: 'localhost', | |
port: 8000, | |
livereload: true, | |
directoryListing: false, | |
open: true | |
})); | |
}); | |
gulp.task('watch', function() { | |
gulp.watch('./src/**/*.html', function(event) {}); | |
gulp.watch('./src/**/sass/*.scss', ['sass']); | |
}); | |
gulp.task('sass', function(event) { | |
gulp.src('./src/sass/*.scss') | |
.pipe(sass()) | |
.pipe(pleeease({ | |
autoprefixer: { | |
browsers: [ 'last 2 versions', 'ie >= 7' ] | |
}, | |
minifier: false | |
})) | |
.pipe(gulp.dest('./src/css')); | |
}); | |
gulp.task('clean', function(cb) { | |
del([ './dest', './tmp', './**/*.log' ], cb); | |
}); | |
gulp.task('usemin', function() { | |
gulp.src('./src/**/*.html') | |
.pipe(usemin({ | |
css: [minifyCss(), 'concat'], | |
//html: [minifyHtml({empty: true})], | |
js: [uglify()] | |
})) | |
.pipe(gulp.dest('./dest/')); | |
}); | |
gulp.task('default', [ 'webserver', 'watch' ]); | |
gulp.task('release', [ 'clean', 'usemin' ]) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment