Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var gulp = require('gulp'),
- sass = require('gulp-sass'),
- jade = require('gulp-jade'),
- connect = require('gulp-connect');
- gulp.task('connectDev', function () {
- connect.server({
- root: ['testing/development', 'tmp'],
- port: 8000,
- livereload: true
- });
- });
- gulp.task('connectDist', function () {
- connect.server({
- root: 'dist/development',
- port: 8001,
- livereload: true
- });
- });
- gulp.task('dist-html', function () {
- gulp.src('dist/development/*.html')
- .pipe(connect.reload());
- });
- gulp.task('testing-html', function () {
- gulp.src('testing/development/*.html')
- .pipe(connect.reload());
- });
- gulp.task('testing-sass', function(){
- return gulp.src('testing/src/scss/**/*.scss')
- .pipe(sass())
- .pipe(gulp.dest('testing/development/css'))
- .pipe(connect.reload());
- });
- gulp.task('dist-sass', function(){
- return gulp.src('dist/src/scss/**/*.scss')
- .pipe(sass())
- .pipe(gulp.dest('dist/development/css'))
- .pipe(connect.reload());
- });
- gulp.task('dist-jade', function(){
- return gulp.src('dist/src/jade/**/*.jade')
- .pipe(jade())
- .pipe(gulp.dest('dist/development/'))
- .pipe(connect.reload());
- });
- gulp.task('testing-jade', function(){
- return gulp.src('testing/src/jade/**/*.jade')
- .pipe(jade())
- .pipe(gulp.dest('testing/development/'))
- .pipe(connect.reload());
- });
- gulp.task('watch', function () {
- gulp.watch(['dist/src/jade/**/*.jade'], ['dist-jade']);
- gulp.watch(['dist/src/scss/**/*.scss'], ['dist-sass']);
- gulp.watch(['dist/development/**/*.html'], ['dist-html']);
- gulp.watch(['testing/src/jade/**/*.jade'], ['testing-jade']);
- gulp.watch(['testing/src/scss/**/*.scss'], ['testing-sass']);
- gulp.watch(['testing/development/**/*.html'], ['testing-html']);
- });
- gulp.task('default', ['connectDist','connectDev', 'watch']);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement