gulp-nodemon
gulp-nodemon copied to clipboard
Gulp 4.0 development
Can a branch be started for gulp-nodemon's new code compatible with Gulp 4.0?
Any progress @JacksonGariety?
@ilanbiala is there a list of changes to Gulp 4 up yet? I have a feeling gulp.start
is going away so there'll have to be a new way to invoke Gulp (hopefully a superior one).
Change log in 4.0 branch.
@ilanbiala it just references a new "bach" task system. There's not really any indication as to wether gulp.start
still exists or not. I'll have to pull it later today and try it out.
@JacksonGariety you can search the code.
@JacksonGariety can you upload your Gulp 4.0 development branch?
@JacksonGariety what's the status on gulp-nodemon for 4.0?
@ilanbiala Just overhauled some parts of gulp-nodemon and bumped version to 2.0. I'm not sure what needs to be done for Gulp 4.0 to be honest, the syntax looks exactly the same. Is there anything specific you're concerned about?
@JacksonGariety what changed? Can a changelog be made so we never need to worry about updating?
Was following along with a tutorial that involved migrating from Gulp 3 to Gulp 4, and Nodemon was the only dependency that appears to have broken. Using version 2.10.1.
It says it required gulp ^3.8.11, but loaded the local version of gulp, which was 4.0.0-alpha.1.
(In other words, looks like Gulp 4 is a breaking change at the moment).
Indeed strange, there appears to be no need to depend on ^3 version of gulp.
One thing which needs to be done is add support for gulp 4 style tasks.. like
gulp.series(task1, gulp.parallel(task2, task3), [task4, task5]);
Hello,
I've just tested with gulp 4.0 and it seams to work correctly with following setup:
gulp.task('run', (done) => {
nodemon({
exec: ".\\node_modules\\.bin\\ts-node --inspect ./src/main.ts",
watch: [
"src/**/*.ts"
],
ext: "ts, js"
});
done();
});
It works fine with gulp 4.0, the contents of the file gulpfile.js are as follows:
const { series, src, dest, watch, parallel } = require('gulp');
const babel = require('gulp-babel');
const nodemon = require('gulp-nodemon');
function compile() {
return src('src/**/*.js')
.pipe(babel())
.pipe(dest('dist'));
}
function watchSrc() {
return watch('src/**/*.js', compile);
};
function start(done) {
nodemon({
script: 'dist/index.js',
ext: 'js',
env: { 'NODE_ENV': 'development' },
done
})
}
exports.compile = compile;
exports.start = start;
exports.default = parallel(series(compile, watchSrc), start);
@fishen This above didn't work for me. Eventually the only thing that worked is to define tasks as so:
task('compile', compile /* The compile function */);
and then reference in the tasks array in nodemon.
However, gulp has stated that this is not the recommended way to do this any longer. @JacksonGariety would it be possible to let tasks take in an array of functions or the newly defined series/parallel functions in gulp 4?
@fishen This above didn't work for me. Eventually the only thing that worked is to define tasks as so:
task('compile', compile /* The compile function */);
and then reference in the tasks array in nodemon. However, gulp has stated that this is not the recommended way to do this any longer. @JacksonGariety would it be possible to let tasks take in an array of functions or the newly defined series/parallel functions in gulp 4?
@darryldaniel what's trouble with u? Is there some error message? please check version of gulp and upgrade it to the latest version.
@fishen I too had to use the old style gulp tasks to get this to work properly. See below.
function watch(done) {
let stream = nodemon({
script: 'dist/bin/www', // run ES5 code
ext: 'js json',
ignore: 'dist',
watch: watchFiles, // watch ES2015 code
tasks: ['nodemon-compile', 'nodemon-copyToDist'], // compile synchronously onChange
done: done,
verbose: true
});
return stream;
}
task('nodemon-compile', compile);
task('nodemon-copyToDist', copyToDist);
exports.runApp = series(setDevEnv, compile, copyToDist, watch);