grunt-userev
Update references to assets versioned with grunt-filerev. Leaner and faster than grunt-usemin, and able to update already versioned references.
Getting Started
This plugin requires Grunt.
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-userev --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt;
The "userev" task
Overview
In your project's Gruntfile, configure userev
to update references to assets versioned by grunt-filerev. It will automatically use grunt.filerev.summary
.
grunt; grunt;
Options
patterns
Type: Object {Key: RegExp}
Default: none
Reference RegExp patterns are matched in source files. The first matched group is checked if it matches ending of any key in grunt.filerev.summary
. The key names are used to log processing of matched patterns.
hash
Type: RegExp
Default: none
If specified, the RegExp pattern is matched against matched references and the first matched group (the hash in filename) is removed. This allows to update the references in source files multiple times without need to regenerate them.
Contributing
Welcome to the project. Choose a way that suits you. You'll need a GitHub account.
Submit a bug, or feature request
- Search existing issues to avoid duplicities.
- Submit an issue with label
bug
, orenhancement
. - For a bug, include any relevant information, e.g. task output, installed OS/Node.js/Grunt/grunt-userev versions, and steps to reproduce.
Submit a pull request
- Fork the repository (help) and checkout new branch with
<type>-
prefix in name, where type may be feature, fix, docs, or chore. - Use the popular JavaScript style convention and winning JavaScript style with exception of 100 characters per line. In short, use 2 spaces indent, camelCase names, trailing comma, single quotes, semicolons, sparse spacing, and no trailing whitespace.
- For bugfix, write a test that exposes the bug and fails without the fix. Submit the test alongside.
- For a new feature, add tests that cover the feature.
- Lint and test your code with
grunt
, orgrunt watch
to watch sources and run tests on any change. - Use commit messages that follow Karma/Angular commit message convention (docs). In short, use
<type>(<scope>): <subject>
header in imperative present tense, message body describing motivation/differences, and footer referencing related issues and breaking changes. - Create a pull request to grunt-userev master branch (help).
Roadmap
- Add tests
Changelog
v0.0.2 (2013-11-21)
Features
v0.0.1 (2013-11-21)
Features
- task: create grunt userev task (d9f515c4)
License
Copyright 2013 Salsita Software. Licensed under the MIT License.