Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wilsson/postcss-url-versioner
https://github.com/wilsson/postcss-url-versioner
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/wilsson/postcss-url-versioner
- Owner: wilsson
- License: mit
- Created: 2017-06-19T04:51:04.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-06-23T03:47:02.000Z (over 7 years ago)
- Last Synced: 2024-04-14T04:43:37.953Z (7 months ago)
- Language: JavaScript
- Size: 85 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# PostCSS Url Versioner [![Build Status][ci-img]][ci]
[PostCSS] plugin url versioner.[json-last-commit]: https://github.com/wilsson/json-last-commit
[PostCSS]: https://github.com/postcss/postcss
[ci-img]: https://travis-ci.org/wilsson/postcss-url-versioner.svg
[ci]: https://travis-ci.org/wilsson/postcss-url-versioner```css
/* Input example */
@font-face {
font-family: 'MyWebFont';
src: url('webfont.eot');
src: url('webfont.eot?#iefix') format('embedded-opentype'),
url('webfont.woff2') format('woff2'),
url('webfont.woff') format('woff'),
url('webfont.ttf') format('truetype'),
url('webfont.svg#svgFontName') format('svg');
}.myImage{
background-image: url("/public/img/other/image3.png");
}
``````css
/* Output example */
@font-face {
font-family: 'MyWebFont';
src: url("webfont.eot?v=46cecf7");
src: url("webfont.eot??v=46cecf7#iefix") format('embedded-opentype'),
url("webfont.woff2?v=46cecf7") format('woff2'),
url("webfont.woff?v=46cecf7") format('woff'),
url("webfont.svg?v=46cecf7#svgFontName") format('svg');
}.myImage{
background-image: url("/public/img/other/image3.png?v=46cecf7");
}
```## Usage
```js
postcss([ require('postcss-url-versioner') ])
```## Options
```js
postcss([
require('postcss-url-versioner')({
variable: 'version',
version: Math.random()
})
])
```## Default Options
```js
{
variable: "v",
lastCommit: "46cecf7"
}
```By default it takes abbreviated commit hash generated by [json-last-commit].
If you want to place your own version use `version` property.
See [PostCSS] docs for examples for your environment.