Skip to content

Instantly share code, notes, and snippets.

@AVStarikovich
Last active October 7, 2016 20:41
Show Gist options
  • Save AVStarikovich/e284aaca0c1424e708f718a568744e5f to your computer and use it in GitHub Desktop.
Save AVStarikovich/e284aaca0c1424e708f718a568744e5f to your computer and use it in GitHub Desktop.
Gulp
var gulp = require('gulp'),
sass = require('gulp-sass'),
pug = require('gulp-pug'),
connect = require('gulp-connect'),
cleanCss = require('gulp-clean-css');
gulp.task('pug', function() {
gulp.src('src/*.pug')
.pipe(pug())
.pipe(gulp.dest('static'))
.pipe(connect.reload());
});
gulp.task('sass', function() {
gulp.src('src/*.sass')
.pipe(sass())
.pipe(cleanCss())
.pipe(gulp.dest('static'))
.pipe(connect.reload());
});
gulp.task('connect', function() {
connect.server({
root: 'static',
port: 1337,
livereload: true
});
});
gulp.task('build', ['sass', 'pug']);
gulp.task('watch', function() {
gulp.watch(['src/*.pug'], ['pug']);
gulp.watch(['src/*.sass'], ['sass']);
});
gulp.task('default', ['build', 'connect', 'watch']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment