4.0.0 • Published 2 years ago
postcss-cachify v4.0.0
PostCSS Cachify
PostCSS plugin to replace assets urls with cachified versions. Companion for connect-cachify-static - rewritten URLs allow for long cache expiration and reliable cache busting for resources referenced in CSS files.
.cachified-relative {
background-image: url('/image.png');
}
.cachified-absolute {
background-image: url('image.png');
}.cachified-relative {
background-image: url('/97ea519347/image.png');
}
.cachified-absolute {
background-image: url('/97ea519347/image.png');
}Options
baseUrl- defaults to/- used to convert relative URLs to absolute URLsbasePath- location of files that will be cachified - defaults to current working directorymatch- regular expression used to filter out files that will be considered for cachifying - defaults to/\.(svg|eot|woff|ttf|png|gif|jpg)$/format-name,pathor function convertingpathandhashprefix into cachified name - defaults topath
Usage
postcss([ require('postcss-cachify') ]);See PostCSS docs for examples for your environment.