gulp-nodemon icon indicating copy to clipboard operation
gulp-nodemon copied to clipboard

Gulp 4.0 development

Open ilanbiala opened this issue 9 years ago • 17 comments

Can a branch be started for gulp-nodemon's new code compatible with Gulp 4.0?

ilanbiala avatar Dec 12 '14 02:12 ilanbiala

Any progress @JacksonGariety?

ilanbiala avatar Dec 25 '14 17:12 ilanbiala

@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).

ColemanGariety avatar Jan 07 '15 20:01 ColemanGariety

Change log in 4.0 branch.

ilanbiala avatar Jan 07 '15 20:01 ilanbiala

@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.

ColemanGariety avatar Jan 07 '15 20:01 ColemanGariety

@JacksonGariety you can search the code.

ilanbiala avatar Jan 10 '15 19:01 ilanbiala

@JacksonGariety can you upload your Gulp 4.0 development branch?

ilanbiala avatar Jan 20 '15 03:01 ilanbiala

@JacksonGariety what's the status on gulp-nodemon for 4.0?

ilanbiala avatar Jan 31 '15 15:01 ilanbiala

@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?

ColemanGariety avatar Mar 19 '15 10:03 ColemanGariety

@JacksonGariety what changed? Can a changelog be made so we never need to worry about updating?

ilanbiala avatar Mar 22 '15 16:03 ilanbiala

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).

hydrosquall avatar Jul 23 '15 22:07 hydrosquall

Indeed strange, there appears to be no need to depend on ^3 version of gulp.

iliakan avatar Jan 11 '16 10:01 iliakan

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]);

yashsriv avatar Dec 21 '16 13:12 yashsriv

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();
});

henioStraszny avatar Feb 18 '17 17:02 henioStraszny

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 avatar Dec 13 '18 12:12 fishen

@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 avatar Feb 11 '19 13:02 darryldaniel

@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 avatar Feb 12 '19 02:02 fishen

@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);

warnero avatar Feb 13 '19 22:02 warnero