lukeed

@taskr/gzip

Gzip plugin for Taskr.

#Install

$ npm install --save-dev @taskr/gzip

#Usage

exports.gzip = function * (task) {
	yield task.source('dist/**/*.*')
		.gzip({
      threshold: 1024,
			ext: 'gzip',
			options: {
				level: 9
			}
		})
		.target('dist');
}

#API

#.gip(opts)

Any files passed through .gzip() will not be affected directly. Instead, a cloned copy will be compressed & have its extension modified. This means your target directory will contain the orginal file and its gzipped copy.

\src
  |- bundle.js
\dist
  |- bundle.js
  |- bundle.js.gz

#opts.ext

Type: string
Default: gz

The extension to append to the compressed file's type.

bundle.js --> bundle.js.gz

#opts.threshold

Type: integer
Default: false

The minimum size, in bytes, required to be compressed. If a file does not satisfy this requirement, it will not be gzipped.

#opts.options

Type: object
Default: {}

The zlib options to pass in.

#Support

Any issues or questions can be sent to the Taskr monorepo.

Please be sure to specify that you are using @taskr/gzip.

#License

MIT © Luke Edwards

See also

taskr(3), clsx(3), @polka/cluster(3), @pwa/cli(3), uvu(3), sockette(3), klona(3), kleur(3), dequal(3), sirv-cli(3)