jstuckey / gulp-gzip

Gzip plugin for gulp.
MIT License
175 stars 17 forks source link

gzip multiple files inside a folder to one single gz file #3

Closed axiantheme closed 10 years ago

axiantheme commented 10 years ago

Hi, is there any parameter we can use to output one single gz file instead of one-by-one gz files, if we gzip a folder which contains some different type files?

jstuckey commented 10 years ago

Hey axian. Unfortunately there isn't an option to compress into one .gz file right now. That is something I want to add eventually though.

jstuckey commented 10 years ago

When I started thinking about this, I realized you can just combine files into a tarball and then gzip the tarball. It turns out there is already a gulp-tar package. You could do something like this (example taken from the gulp-tar readme file):

var gulp = require('gulp');
var tar = require('gulp-tar');
var gzip = require('gulp-gzip');

gulp.task('default', function () {
    gulp.src('src/*')
        .pipe(tar('archive.tar'))
        .pipe(gzip())
        .pipe(gulp.dest('dist'));
});
axiantheme commented 10 years ago

Hello @jstuckey Thanks, but with this method, I can't un-archive the package. It's said that the package is damaged...

jstuckey commented 10 years ago

I made a change related to this. Try updating gulp-gzip to version 0.0.5. It should work now.

axiantheme commented 10 years ago

@jstuckey You rock! :dancers: v.0.0.5 is perfect now. Thanks for your nice job and great help!

jstuckey commented 10 years ago

Great! Glad to help.