This repository was archived by the owner on Mar 26, 2018. It is now read-only.
File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,8 @@ module.exports = function (grunt) {
9
9
grunt . registerMultiTask ( 'filerev' , 'File revisioning based on content hashing' , function ( ) {
10
10
var options = this . options ( {
11
11
algorithm : 'md5' ,
12
- length : 8
12
+ length : 8 ,
13
+ basename : false
13
14
} ) ;
14
15
var target = this . target ;
15
16
var filerev = grunt . filerev || { summary : { } } ;
@@ -74,8 +75,13 @@ module.exports = function (grunt) {
74
75
}
75
76
}
76
77
77
- filerev . summary [ path . normalize ( file ) ] = path . join ( dirname , newName ) ;
78
- grunt . verbose . writeln ( chalk . green ( '✔ ' ) + file + chalk . gray ( ' changed to ' ) + newName ) ;
78
+ if ( options . basename ) {
79
+ filerev . summary [ path . basename ( file ) ] = newName ;
80
+ } else {
81
+ filerev . summary [ path . normalize ( file ) ] = path . join ( dirname , newName ) ;
82
+ }
83
+ grunt . log . writeln ( chalk . green ( '✔ ' ) + file + chalk . gray ( ' changed to ' ) + newName ) ;
84
+
79
85
if ( sourceMap ) {
80
86
filerev . summary [ path . normalize ( file + '.map' ) ] = path . join ( dirname , newName + '.map' ) ;
81
87
grunt . verbose . writeln ( chalk . green ( '✔ ' ) + file + '.map' + chalk . gray ( ' changed to ' ) + newName + '.map' ) ;
You can’t perform that action at this time.
0 commit comments