Skip to content

pirxpilot/postcss-cachify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NPM version Build Status Dependency Status

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 URLs
  • basePath - location of files that will be cachified - defaults to current working directory
  • match - regular expression used to filter out files that will be considered for cachifying - defaults to /\.(svg|eot|woff|ttf|png|gif|jpg)$/
  • format - name, path or function converting path and hash prefix into cachified name - defaults to path

Usage

postcss([ require('postcss-cachify') ]);

See PostCSS docs for examples for your environment.

About

PostCSS plugin to replace assets urls with cachified versions.

Resources

License

Stars

Watchers

Forks

Packages

No packages published