postcss-query-hash
Output a manifest file for cache busting.
Usage
CLI
# input
postcss ./src/**/*.css -d /dist
# output manifest.json
{
"/dist/style.css":"/dist/style.css?a516675ef8",
"/dist/user/user.css":"/dist/user/user.css?gh9848whf"
}
Node script
# input const postcss = const fs = const queryHash = const glob = const promisify = const readFile = const CWD = __dirnameconst SRC = `/src`const DIST = `/dist`const MANIFEST = `/manifest.json`const files = glob try fs catch _ {} files # output manifestjson "/dist/style.css":"/dist/style.css?a516675ef8" "/dist/user/user.css":"/dist/user/user.css?gh9848whf"
Options
algorithm
Type: String
Default: md5
Uses node's inbuilt crypto module. Pass any digest algorithm that is supported in your environment.
manifest
Type: String
Default: ./manifest.json
Output destination of the manifest file.
license
MIT