I've the following gulp build process in place.
gulp.task("watch", function(){
gulp.watch("public/admin/js/**/*.js", ["login"]);
}
gulp.task("login", function() {
var js = [
"!public/admin/js/api",
"public/admin/js/*.js",
"public/admin/js/controller/**/*.js",
"public/admin/js/model/**/*.js",
"public/admin/js/view/**/*.js"
];
gulp.src(js)
.pipe(concat("app.min.js"))
.pipe(gulp.dest("public/admin/js"));
});
1) I'm unable to add files that are in the root. public/admin/js/*.js
, is not working
2) I feel there's a bit of duplication involved, if someone can please help me rewrite this. In short I want to concatenate all under /public/admin
minus /public/admin/api
P.S. and of course don't wanna include app.min.js
again from the last build which is of course will be on the root.
P.P.S I've this build process repeated for several project folders over and over again, any ideas for re-using this logic. right now I'm setting up different watches for each folder and building their app.min.js.