Created
July 19, 2016 14:47
-
-
Save chrisvasey/37ac9cc94f07f7b0a1fd3aef46f095ba to your computer and use it in GitHub Desktop.
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
//npm install browser-sync gulp --save-dev | |
var gulp = require("gulp"); | |
var less = require('gulp-less'); | |
var path = require('path'); | |
var browserSync = require("browser-sync").create(); | |
// Static Server + watching scss/html files | |
gulp.task('serve', ['less'], function() { | |
browserSync.init({ | |
server: "./" | |
}); | |
gulp.watch("css/**/*.less", ['less']); | |
gulp.watch("./*.html").on('change', browserSync.reload); | |
}); | |
/** | |
* Compile with gulp-less + source maps | |
*/ | |
gulp.task('less', function () { | |
return gulp.src('./css/**/*.less') | |
.pipe(less({ | |
paths: [ path.join(__dirname, 'less', 'includes') ] | |
})) | |
.pipe(gulp.dest('./public/css')) | |
.pipe(browserSync.stream({match: '**/*.css'})); | |
}); | |
gulp.task('default', ['serve']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment