Watching file changes with npm scripts
at mikej.codes▼2 up and 0 down, posted by
2 up and 0 down, posted by
Gulp is only suited to problems which can be represented as streams. Certain things, like copying files from a dir to another, firing up mock server, etc, are a pain in the neck with gulp. I moved from gulp to npm scripts and never looked back.
If those are the reasons, I'm even less convinced to switch to npm scripts. Copying files is as easy as gulp.src(toBeCopiedGlob) .pipe(gulp.dest(destDir)); For the rest, Gulp tasks are just JavaScript functions. You're not actually forced to use gulp.src or any other method. You can start shell scripts, you can spawn servers, command livereloading, perform computations and evaluate conditions, etc. and, above all, you have a direct connection with the underling JavaScript application, as you can actually import its modules. In addition to this, I have a consistent interface in which I can define parameters and help texts, and that's definitely a plus for anyone who's looking at the project's tasks for the first time.