Skip to content

Instantly share code, notes, and snippets.

@joshuakfarrar
Created September 14, 2015 15:33
Show Gist options
  • Save joshuakfarrar/c0ccfddeeaeda84041e2 to your computer and use it in GitHub Desktop.
Save joshuakfarrar/c0ccfddeeaeda84041e2 to your computer and use it in GitHub Desktop.
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