javascript - Using Gulp Zip to zip all the files in a folder -
i using gulp-zip zip source files. have main folder called fifa has other sub folders might have more sub folders , files. in additon fifa folder has files package.json, gulp.js , other files. want use gulp-zip zip entire project , create folder called distribution , save zip inside it. code used.
gulp.task('zip', function () { return gulp.src('./*,') .pipe(zip('test.zip')) .pipe(gulp.dest('./distribution')); });
the issue although zip created inside distribution folder zip contains files inside fifa folder, files inside subfolders of fifa not there. instance if fifa has subfolder called ronaldo , ronaldo contains goal.js goal.js not in zip. have done wrong? please advice.
try 2 *
gulp.task('zip', function () { return gulp.src('./**') .pipe(zip('test.zip')) .pipe(gulp.dest('./distribution')); });
what's difference between
*
,**
?
one star means files, no folders - stars more deep , include folders inside specified folder.
and instance if wanted 2 stars include folders except 1 specific folder , possible also?
you can use exclamation mark !./excludeddir
, pass src
array !...
1 of values
Comments
Post a Comment