Created
August 11, 2016 13:00
-
-
Save yangshun/3ead2d96496f6a11757b6969cf7d4e50 to your computer and use it in GitHub Desktop.
Static web server with styles watching
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
'use strict'; | |
var gulp = require('gulp'); | |
var sass = require('gulp-sass'); | |
var webserver = require('gulp-webserver'); | |
gulp.task('sass', function () { | |
return gulp.src('./sass/**/*.scss') | |
.pipe(sass().on('error', sass.logError)) | |
.pipe(gulp.dest('./css')); | |
}); | |
gulp.task('sass:watch', function () { | |
gulp.watch('./sass/**/*.scss', ['sass']); | |
}); | |
gulp.task('serve', function() { | |
gulp.src('./') | |
.pipe(webserver({ | |
livereload: true, | |
open: true | |
})); | |
}); | |
gulp.task('default', ['sass', 'sass:watch', 'serve']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment