javascript - Target only the contents of a folder in gulp -


i'm using gulp compile project. i'm using gulp-zip zip bunch of files.

i want zip files in "dist" folder, i'm using this:

var thesrc: ['dist/**/*']; gulp.task('createmainzip', ['createpluginzip'], function () {     return gulp.src(thesrc)     .pipe(zip('main_files.zip'))     .pipe(gulp.dest('compiled')); }); 

this compiles files zip in following way:

  • dist
    • file.css
    • another.js
    • folder
      • file.js

however, want this:

  • file.css
  • another.js
  • folder
    • file.js

without dist folder. there way using different src path?

thanks help.

gulp-zip doesn't honor base. see background:

now, can (admittedly ugly):

var gulp = require('gulp'); var zip = require('gulp-zip'); var thesrc = ['**/*']; gulp.task('createmainzip', function () {   return gulp.src(thesrc, {cwd: __dirname + "/dist"})   .pipe(zip('main_files.zip'))   .pipe(gulp.dest('compiled')); }); 

Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -