gulp-web-compress
A gulp plugin to optionally compress output with gzip and brotli.
Usage
;;; gulp;
gulp.dest
must be called before and after gulpWebCompress
. The first call to
gulp.dest
generates source-map files and writes the uncompressed files. All
files (including source-maps) are then passed to gulpWebCompress
which produces
*.gz
and *.br
files. Only compressed files reach the second call to gulp.dest
.
gulpCompress(options)
options.types
An array of zero or more strings can be provided.
Default ['br', 'gz]
Valid types are br
for brotli compression, gz
for gzip compression.
options.skipLarger
This prevents creation of compressed files that are larger than the uncompressed files.
Default true
options.gzipOptions
See node.js zlib options documentation. Example:
options.brotliOptions
See brotliEncodeParams documentation. Example: