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:
- https://github.com/sindresorhus/gulp-zip/issues/10
- https://github.com/sindresorhus/gulp-zip/pull/11
- https://github.com/sindresorhus/gulp-zip/blob/master/index.js#l30
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
Post a Comment