Created
September 14, 2015 15:33
-
-
Save joshuakfarrar/c0ccfddeeaeda84041e2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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'); | |
var nodemon = require('gulp-nodemon'); | |
var del = require('del'); | |
// server | |
var babel = require('gulp-babel'); | |
// client | |
var browserify = require('browserify'); | |
var babelify = require('babelify'); | |
var through2 = require('through2'); | |
var stylus = require('gulp-stylus'); | |
gulp.task('stylus', () => { | |
del.sync('./dist/css'); | |
return gulp.src('./client/stylus/**/*.styl') | |
.pipe(stylus().on('error', function(err) { | |
console.error(err); | |
this.emit('end'); | |
})) | |
.pipe(gulp.dest('./dist/css')); | |
}); | |
gulp.task('compile', () => { | |
del.sync('./server/lib'); | |
return gulp.src('./server/src/**/*.js') | |
.pipe(babel()) | |
.pipe(gulp.dest('./server/lib')) | |
}); | |
gulp.task('serve', ['compile', 'stylus'], () => { | |
gulp.watch('./client/stylus/**/*.styl', ['stylus']); | |
return nodemon({ | |
script: './server', | |
ignore: [ | |
'./server/lib/*.js', | |
'./node_modules' | |
], | |
tasks: ['compile'], | |
env: { 'NODE_ENV': 'development' } | |
}); | |
}); | |
gulp.task('default', () => { | |
console.log("hej."); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment