Precompress a directory of assets
precompress
will recursively compress all suitable assets in a given directory,
creating (or replacing) compressed versions of the original files using the
appropriate extension type (e.g. gzip: index.html
-> index.html.gz
).
Using cargo
:
sh
cargo install precompress
``` $ precompress -h precompress 0.2.0 Precompress a directory of assets
USAGE:
precompress [OPTIONS]
ARGS:
OPTIONS:
--brotli
--brotli-quality <BROTLI_QUALITY>
Set brotli compression quality [default: 11]
--deflate <DEFLATE>
Enable deflate compression [possible values: true, false]
--deflate-quality <DEFLATE_QUALITY>
Set deflate compression quality [default: 9]
--gzip <GZIP>
Enable gzip compression [possible values: true, false]
--gzip-quality <GZIP_QUALITY>
Set gzip compression quality [default: 9]
-h, --help
Print help information
-t, --threads <THREADS>
Number of threads to use; "0" uses the number of cpus [default: 0]
-V, --version
Print version information
--zstd <ZSTD>
Enable zstd compression [possible values: true, false]
--zstd-quality <ZSTD_QUALITY>
Set zstd compression quality [default: 21]
```
Precompress the files in the current directory using brotli, deflate, and gzip:
precompress --brotli --deflate --gzip .
precompress
is released under the MIT license.
Please see the LICENSE file for more details.