Moving requires into individual tasks

This commit is contained in:
Jeff Avallone 2014-11-23 17:17:29 -05:00
parent 074d1081ce
commit 9fc138d87d

View File

@ -1,11 +1,4 @@
var gulp = require('gulp'), 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');
gulp.task('default', ['server'], function() { gulp.task('default', ['server'], function() {
gulp.watch('./src/**/*.!(html|scss|js)', ['static']); gulp.watch('./src/**/*.!(html|scss|js)', ['static']);
@ -15,6 +8,9 @@ gulp.task('default', ['server'], function() {
}); });
gulp.task('server', ['build'], function() { gulp.task('server', ['build'], function() {
var connect = require('gulp-connect'),
watch = require('gulp-watch');
watch('./build/**/*', { name: 'Server' }) watch('./build/**/*', { name: 'Server' })
.pipe(connect.reload()); .pipe(connect.reload());
return connect.server({ return connect.server({
@ -31,12 +27,16 @@ gulp.task('static', function() {
}); });
gulp.task('markup', function() { gulp.task('markup', function() {
var wrap = require('gulp-wrap');
return gulp.src('./src/**/*.html') return gulp.src('./src/**/*.html')
.pipe(wrap({ src: './template.html' })) .pipe(wrap({ src: './template.html' }))
.pipe(gulp.dest('./build')); .pipe(gulp.dest('./build'));
}); });
gulp.task('compass', function() { gulp.task('compass', function() {
var compass = require('gulp-compass');
return gulp.src('./src/**/*.scss') return gulp.src('./src/**/*.scss')
.pipe(compass({ .pipe(compass({
sass: './src/sass', sass: './src/sass',
@ -48,7 +48,10 @@ gulp.task('compass', function() {
}); });
gulp.task('browserify', function() { gulp.task('browserify', function() {
var bundler = browserify({ var browserify = require('browserify'),
es6ify = require('es6ify'),
source = require('vinyl-source-stream');
bundler = browserify({
entries: ['./main.js'], entries: ['./main.js'],
basedir: './src/js', basedir: './src/js',
debug: true, debug: true,