Last active
February 21, 2016 05:08
-
-
Save sunilw/c6c781ee2ad471d13ddc to your computer and use it in GitHub Desktop.
Simple gulpfile. Support for sass, browsersyncs. Sourcemap support yet to be thoroughly tested
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 sass = require('gulp-sass') ; | |
var watch = require('gulp-watch') ; | |
var sourcemaps = require('gulp-sourcemaps'); | |
var browserSync = require('browser-sync'); | |
gulp.task('sass', function () { | |
return gulp.src('./src/sass/**.scss') | |
.pipe(watch('./src/sass/**.scss')) | |
.pipe(sourcemaps.init()) | |
.pipe(sass().on('error', sass.logError)) | |
.pipe(sourcemaps.write()) | |
.pipe(gulp.dest('./css')) | |
.pipe(browserSync.stream()) ; | |
}); | |
gulp.task('bs-reload', function () { | |
browserSync.reload(); | |
}); | |
gulp.task('serve', function() { | |
browserSync({ | |
files: "css/*.css", | |
server: { | |
baseDir: "." | |
} | |
}); | |
gulp.watch("./*.html").on('change', browserSync.reload); | |
gulp.watch("./css/**").on('change', browserSync.reload); | |
}); | |
gulp.task('default', [ 'sass', 'serve']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment