javascript - Building a gulp proj with sub-projects - how can I use globs &/or require-all to run tasks on multiple sub-projects? -


i'm building project using gulp-chug run tasks using gulpfiles in multiple sub-projects. works great slow , feel using globs or more efficient.

my example proj this:

gulpfile.js src/    160x600/    300x600/    300x250/    768x90/ 

all of sub-directories in "src/" dir mini-websites .js, .css, .html files, etc. , identical in folder structure. create gulp tasks in main gulpfile.js run identical tasks on each sub-project. instance, generating spritemap each project dependent on images located in each of "images/" directory.

currently, in each sub-projects' gulpfile.js have code runs fine:

var spritedata = gulp.src(process.cwd()+'/assets/images/*').pipe(spritesmith({}) //the "src" output is: src/160x600/assets/images... 

the above works great using gulp-chug. if try , remove gulp-chug , bring code main gulp file using globs seems freeze in console or err:

var spritedata = gulp.src('./src/**/assets/images/*').pipe(spritesmith({}) 

this latter example more solution going for. reason seems hangup in console until cancel process.

anyway, first time posting here! grateful figuring out best way getting work. i've read in other posts use 'require-all'. looked @ docs , don't understand how module work in case. :)


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -