Skip to content

Instantly share code, notes, and snippets.

@chrisloftus chrisloftus/gulpfile.js
Last active Aug 29, 2015

Embed
What would you like to do?
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
You can’t perform that action at this time.