Skip to content

Instantly share code, notes, and snippets.

@chrisloftus
Last active August 29, 2015 14:14
Show Gist options
  • Save chrisloftus/5c4df88b0dd8671db3e5 to your computer and use it in GitHub Desktop.
Save chrisloftus/5c4df88b0dd8671db3e5 to your computer and use it in GitHub Desktop.
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefix = require('gulp-autoprefixer'),
notify = require('gulp-notify'),
browserSync = require('browser-sync'),
reload = browserSync.reload
;
var config = {
sassPath: './resources/sass'
};
gulp.task('sass', function() {
return sass('./resources/sass', {
loadPath: ['./node_modules/bootstrap-sass/assets/stylesheets']
})
.on('error', function (err) {
console.log('Error!', err.message);
})
.pipe( autoprefix('last 2 versions') )
.pipe( gulp.dest('./public/stylesheets') )
.pipe( reload( {stream: true} ) )
;
});
gulp.task('html', function() {
return gulp.src('./public/*.html')
.pipe(gulp.dest('./public'));
});
gulp.task('browser-sync', function() {
browserSync({
proxy: 'mlm.local'
});
});
// Rerun the task when a file changes
gulp.task('watch', function() {
gulp.watch(config.sassPath + '/**/*.scss', ['sass']);
gulp.watch('./public/*.html', ['html', reload]);
});
gulp.task('default', ['sass', 'browser-sync', 'watch']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment