Last active
December 7, 2015 09:48
-
-
Save iorionda/6bedc1721d6dff9d79ad to your computer and use it in GitHub Desktop.
This file contains 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
g = require 'gulp' | |
$ = require 'gulp-load-plugins' | |
nodemon = require 'gulp-nodemon' | |
mocha = require 'gulp-mocha' | |
browserSync = require 'browser-sync' | |
g.task 'browserSync', ['nodemon'], -> | |
browserSync.init null, { | |
files: ['public/**/*.*', 'views/**/*.*', 'routes/**/*.*'], | |
proxy: 'http://localhost:3000', | |
port: 4000 | |
} | |
g.task 'nodemon', (cd) -> | |
BROWSER_SYNC_TIMING = 5000 | |
called = false | |
nodemon { | |
script: './bin/www', | |
ext: 'js html css jade styl coffee', | |
ignore: [ | |
'node_modules', | |
'bin', | |
'test' | |
], | |
env: { | |
'NODE_ENV': 'development' | |
}, | |
stdout: false | |
} | |
.on 'start', -> | |
if(!called) | |
cd() | |
called = true | |
.on 'restart', -> | |
setTimeout -> | |
browserSync.reload {stream: false} | |
, BROWSER_SYNC_TIMING | |
g.task 'test', -> | |
g.src ['./test/**/*.js', './test/**/*.coffee'] | |
.pipe mocha {reporter: 'nyan'} | |
g.task 'default', ['browserSync'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment