jstuckey / gulp-gzip

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

prevent gzip from compressing already gzipped files #25

Open Priyanka-Aher opened 7 years ago

Priyanka-Aher commented 7 years ago

How do I get gzip to not gzip/compress already gzipped files? I am gzipping svg files, not changing their extension, so essentially the name of the file remains the same. Everytime I do a build and the gulp task runs, it gzips these files over and over again. I don't want this to happen.

/*********************************************
*
* gzip svg image files
*
***********************************************/
gulp.task('gzipSvg',function(){
    return gulp.src('src/main/resources/images/**/*.svg')
        .pipe(gzip({ append: false }))
        .pipe(gulp.dest('src/main/resources/images'));
});