puv

postcss-url-versioner

PostCSS plugin url versioner

Showing:

Popularity

Downloads/wk

1

GitHub Stars

1

Maintenance

Last Commit

4yrs ago

Contributors

15

Package

Dependencies

2

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

PostCSS Url Versioner Build Status

PostCSS plugin url versioner.

/* 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");
}
/* 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

postcss([ require('postcss-url-versioner') ])

Options

postcss([ 
  require('postcss-url-versioner')({ 
    variable: 'version',
    version: Math.random()
  })
])

Default Options

{
    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.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial