hashly
Version:
Renames static files with a hashcode for cache busting
45 lines (43 loc) • 3.87 kB
Plain Text
usage: hashly [option option=parameter ...] <source> [destination]
Source refers to the root directory from which root relative paths will be based.
If source is omitted, the current working directory will be used.
If destination is omitted, hashed files will be written alongside the source files.
A list of files can be piped in to hashly from stdin.
options:
-h, --help Print help (this message) and exit.
-v, --verbose Emit verbose output
--include A globbing expression. If specified, only matching files will be processed.
-e, --exclude A globbing expression. Any matching files will not be processed. Takes precedence over --include.
--passthrough A globbing expression. Any matching files will be copied as-is to the destination folder.
Has no effect if the destination is the same as the source.
-m, --manifest-format The format for the manifest file. Currently supports "json", "json-object" (json with original
path as key) or "tab" (tab delimited).
Default is "json".
-b, --base-dir Specifies the path to a folder. If specified, all paths included in the manifest will be
prefixed with this path.
--manifest-path Specifies a path for the manifest file. If not specified, the manifest is named "manifest.{ext}"
and is placed in the destination directory root.
-a, --amend Instructs hashly to amend an existing manifest, where it would normally delete and recreate it
from scratch. This is useful for incrementally adding to a large filesystem
without incurring the performance penalty of reprocessing existing files.
-s, --skip-css Skip replacement of image paths in CSS files. If not specified, relative
(and root relative) image paths will be replaced with the hashed version.
-q, --quickhash Use the file size for binary files instead of the file contents. This makes processing large binary
files extremely quick, though at a (extremely slight) risk that a hashcode will not change when a
file is updated.
-l, --hash-length Specifies the length of the hash used when renaming files. Default is 32 characters.
-f, --rename-format Specifies the format to use when renaming files. Variables are specified using curly brackets
(e.g., {variable}). Any other characters are directly included in the output.
Available variables include:
- {basename}: the base filename without extension
- {hash}: the hash value
- {extname}: the file extension
Default is "{basename}-hc{hash}{extname}".
-i, --ignore-errors Ignore errors. Otherwise, hashly will abort on the first error.
--ignore-plugin-errors Ignore errors from plugins. Takes precedence over --ignore-errors.
--disabled-plugins Semicolon-delimited list of plugin names that should be disabled.
-c, --clean Deletes the manifest and all files generated by hashly
--clean-old Deletes files that aren't in the manifest and are older than the specified number of days.
--sourcemap-include-path Include the absolute path to the source map in the JS/CSS source, relative to base-dir.
Default: true.
--sourcemap-url-prefix A URL prefix to apply to the source map tag, if it is not in the same location as the source.