Last active
October 7, 2016 20:41
-
-
Save AVStarikovich/e284aaca0c1424e708f718a568744e5f to your computer and use it in GitHub Desktop.
Gulp
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
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