diff --git a/README.md b/README.md index 796d03e..609046b 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ $ npm install --save-dev gulp-nodemon ## Usage -Gulp-nodemon is almost exactly like regular nodemon, but it's made for use with gulp tasks. +gulp-nodemon is almost exactly like regular nodemon, but it's made for use with gulp tasks. ### **nodemon([options])** @@ -84,7 +84,7 @@ gulp-nodemon returns a stream just like any other NodeJS stream, **except for th The following example will run your code with nodemon, lint it when you make changes, and log a message when nodemon runs it again. ```js -// Gulpfile.js +// gulpfile.js var gulp = require('gulp') , nodemon = require('gulp-nodemon') , jshint = require('gulp-jshint') @@ -163,7 +163,7 @@ gulp.task('run', ['default', 'watch'], function(done) { ## Using `gulp-nodemon` with React, Browserify, Babel, ES2015, etc. -Gulp-nodemon is made to work with the "groovy" new tools like Babel, JSX, and other JavaScript compilers/bundlers/transpilers. +gulp-nodemon is made to work with the "groovy" new tools like Babel, JSX, and other JavaScript compilers/bundlers/transpilers. In gulp-nodemon land, you'll want one task for compilation that uses an on-disk cache (e.g. `gulp-file-cache`, `gulp-cache-money`) along with your bundler (e.g. `gulp-babel`, `gulp-react`, etc.). Then you'll put `nodemon({})` in another task and pass the entire compile task in your config: diff --git a/Gulpfile.js b/gulpfile.js similarity index 73% rename from Gulpfile.js rename to gulpfile.js index e25efd2..8e13ec9 100644 --- a/Gulpfile.js +++ b/gulpfile.js @@ -1,25 +1,25 @@ var gulp = require('gulp') + , gulpnodemon = require('./index') , jshint = require('gulp-jshint') - , nodemon = require('./index') -// , path = require('path') + , nodemon = require('nodemon') gulp.task('lint', function (){ return gulp.src('./*/**.js') .pipe(jshint()) }) -gulp.task('cssmin', function (done){ +gulp.task('afterrestart', function (done){ + console.log('proc has finished restarting!') done(); }) -gulp.task('afterstart', function (done){ - console.log('proc has finished restarting!'); +gulp.task('cssmin', function (done){ done(); }) gulp.task('test', gulp.series('lint', function (done){ - var stream = nodemon({ - nodemon: require('nodemon') + var stream = gulpnodemon({ + nodemon: nodemon , script: './server.js' , verbose: true , env: { @@ -31,7 +31,7 @@ gulp.task('test', gulp.series('lint', function (done){ }) stream - .on('restart', 'cssmin') + .on('restart', 'afterrestart') .on('crash', function (){ console.error('\nApplication has crashed!\n') console.error('Restarting in 2 seconds...\n') diff --git a/index.js b/index.js index 34b2dd0..8545424 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,6 @@ 'use strict' var nodemon - , colors = require('colors') , gulp = require('gulp') , cp = require('child_process') , bus = require('nodemon/lib/utils/bus') diff --git a/package.json b/package.json index af3fd2a..2cf72ad 100644 --- a/package.json +++ b/package.json @@ -28,17 +28,12 @@ }, "homepage": "https://github.com/JacksonGariety/gulp-nodemon", "dependencies": { - "colors": "^1.2.1", - "event-stream": "^3.3.4", "gulp": "^4.0.0", "nodemon": "^1.17.5" }, "devDependencies": { - "should": "^4.0.0", - "gulp-jshint": "^1.6.1", - "gulp-mocha": "^0.2.0", - "is-running": "^1.0.3", - "coffee-script": "^1.7.1" + "gulp-jshint": "^2.1.0", + "jshint": "^2.9.5" }, "directories": { "test": "test"