From 9fc138d87defee1064b1b30ca389b6d992e7f536 Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Sun, 23 Nov 2014 17:17:29 -0500 Subject: [PATCH] Moving requires into individual tasks --- gulpfile.js | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 4ad4c22..8b30f22 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,11 +1,4 @@ -var gulp = require('gulp'), - wrap = require('gulp-wrap'), - connect = require('gulp-connect'), - watch = require('gulp-watch'), - compass = require('gulp-compass'), - browserify = require('browserify'), - es6ify = require('es6ify'), - source = require('vinyl-source-stream'); +var gulp = require('gulp'); gulp.task('default', ['server'], function() { gulp.watch('./src/**/*.!(html|scss|js)', ['static']); @@ -15,6 +8,9 @@ gulp.task('default', ['server'], function() { }); gulp.task('server', ['build'], function() { + var connect = require('gulp-connect'), + watch = require('gulp-watch'); + watch('./build/**/*', { name: 'Server' }) .pipe(connect.reload()); return connect.server({ @@ -31,12 +27,16 @@ gulp.task('static', function() { }); gulp.task('markup', function() { + var wrap = require('gulp-wrap'); + return gulp.src('./src/**/*.html') .pipe(wrap({ src: './template.html' })) .pipe(gulp.dest('./build')); }); gulp.task('compass', function() { + var compass = require('gulp-compass'); + return gulp.src('./src/**/*.scss') .pipe(compass({ sass: './src/sass', @@ -48,11 +48,14 @@ gulp.task('compass', function() { }); gulp.task('browserify', function() { - var bundler = browserify({ - entries: ['./main.js'], - basedir: './src/js', - debug: true, - }); + var browserify = require('browserify'), + es6ify = require('es6ify'), + source = require('vinyl-source-stream'); + bundler = browserify({ + entries: ['./main.js'], + basedir: './src/js', + debug: true, + }); bundler.add(es6ify.runtime); bundler.transform(es6ify);