Skip to content

Instantly share code, notes, and snippets.

@olafgleba
Last active December 4, 2015 22:50
Show Gist options
  • Save olafgleba/60ac0da31ab449796faa to your computer and use it in GitHub Desktop.
Save olafgleba/60ac0da31ab449796faa to your computer and use it in GitHub Desktop.
LibSass + CSS Injection
var gulp = require('gulp');
var sass = require('gulp-sass');
var bs = require('browser-sync').create();
var runSequence = require('run-sequence');
gulp.task('browser-sync', function() {
bs.init({
server: {
baseDir: './'
}
});
});
gulp.task('process:sass', function() {
return gulp.src('**/*.scss')
.pipe(sass())
.pipe(gulp.dest('./styles.css'))
.pipe(bs.stream());
});
gulp.task('watch-all', function() {
gulp.watch('**/*.scss', ['sass']);
});
gulp.task('default', function() {
runSequence(['sass','watch-all'], 'browser-sync');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment