I'm trying to run a set of tasks in series, that is one after the other in Gulp 4.0 however when I add my 3rd task my gulp code breaks.
gulp.task('concat-js', (done) => {
gulp.src([
'app1.js',
'app2.js',
])
.pipe(concat("app.js"))
.pipe(gulp.dest('build'))
done();
});
gulp.task('concat-css', (done) => {
gulp.src([
'.styles1.css',
'.style2.css'
])
.pipe(concat("app.css"))
.pipe(gulp.dest('build'))
done();
});
gulp.task('minify-js', (done) => {
gulp.src('./build/app.js')
.pipe(uglify())
.pipe(gulp.dest('./build/'))
done();
})
//this works & creates /build with the app.js & app.css files
gulp.task('build-production-static-resource', gulp.series('concat-js', 'concat-css',, (done) => {
done();
}));
If I delete the build folder to start all over & try adding another task (minfy-js), my third task fails & the build folder also doesn't get created.
//File not found with singular glob: /Users/user/myapp/build/app.js
gulp.task('build-production-static-resource', gulp.series('concat-js', 'concat-css', 'minify-js', (done) => {
done();
}));