Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
grunt-userev
Advanced tools
Update references to assets versioned with grunt-filerev. Leaner and faster than grunt-usemin, and able to update already versioned references.
Update references to assets versioned with grunt-filerev. Leaner and faster than grunt-usemin, and able to update already versioned references.
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.loadNpmTasks('grunt-userev');
In your project's Gruntfile, configure userev
to update references to assets versioned by grunt-filerev. It will automatically use grunt.filerev.summary
.
grunt.initConfig({
filerev: {
options: {
encoding: 'utf8',
algorithm: 'md5',
length: 8
},
sourcemaps: { // Rename sourcemaps.
src: ['build/css/*.map.css', 'build/js/*.map.js'],
},
assets: { // Rename minified js/css.
src: ['build/css/*.css', 'build/js/*.js', '!build/css/*.map.css', '!build/js/*.map.js'],
},
},
userev: {
options: {
hash: /(\.[a-f0-9]{8})\.[a-z]+$/,
},
assets: { // Link to sourcemaps in minified js/css.
src: ['build/css/*.css', 'build/js/*.js', '!build/css/*.map.css', '!build/js/*.map.js'],
options: {
patterns: {
'Linking versioned source maps': /sourceMappingURL=([a-z0-9.]*\.map)/,
},
},
},
index: { // Link to minified js/css in index html.
src: 'build/index.html',
options: {
patterns: {
'Linking versioned assets': /(css\/[a-z0-9.]*\.css)/,
},
},
},
},
});
grunt.registerTask( 'rev', [
'filerev:sourcemaps', // Rename sourcemaps.
'userev:assets', // Link to sourcemaps in minified js/css.
'filerev:assets', // Rename minified js/css.
'userev:index', // Link to minified js/css in index html.
]);
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.
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.
Welcome to the project. Choose a way that suits you. You'll need a GitHub account.
bug
, or enhancement
.<type>-
prefix in name, where type may be feature, fix, docs, or chore.grunt
, or grunt watch
to watch sources and run tests on any change.<type>(<scope>): <subject>
header in imperative present tense, message body describing motivation/differences, and footer referencing related issues and breaking changes.Copyright 2013 Salsita Software. Licensed under the MIT License.
FAQs
Update references to assets versioned with grunt-filerev. Leaner and faster than grunt-usemin, and able to update already versioned references.
The npm package grunt-userev receives a total of 4 weekly downloads. As such, grunt-userev popularity was classified as not popular.
We found that grunt-userev demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.