Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Gulp4 #150

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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])**

Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -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:

Expand Down
16 changes: 8 additions & 8 deletions Gulpfile.js → gulpfile.js
Original file line number Diff line number Diff line change
@@ -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: {
Expand All @@ -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')
Expand Down
1 change: 0 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict'

var nodemon
, colors = require('colors')
, gulp = require('gulp')
, cp = require('child_process')
, bus = require('nodemon/lib/utils/bus')
Expand Down
9 changes: 2 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down