grunt-filerev
grunt-filerev copied to clipboard
Wrong paths in grunt.filerev.summary when a cwd was defined
Okay, next one:
When I have this grunt config
filerev: {
images: {
expand: true,
cwd: 'client',
src: 'images/site/**/*.*',
dest: 'server/public
}
Then we have those entries in grunt.filerev.summary:
{
'client/images/site/btn/facebook-login-btn.png': 'server/public/images/site/btn/facebook-login-btn.7e70e4e8.png',
'client/images/site/btn/facebook-signup-btn.png': 'server/public/images/site/btn/facebook-signup-btn.071c597b.png',
'client/images/site/btn/google-login-btn.png': 'server/public/images/site/btn/google-login-btn.d8f30867.png',
'client/images/site/btn/google-signup-btn.png': 'server/public/images/site/btn/google-signup-btn.5df3ce2e.png'
}
But I do not want the client part in them. Because of the cwd option. Same goes with the destination part, server/public should not be here. Ideally I want something like this:
Then we have those entries in grunt.filerev.summary:
{
'images/site/btn/facebook-login-btn.png': 'images/site/btn/facebook-login-btn.7e70e4e8.png',
'images/site/btn/facebook-signup-btn.png': 'images/site/btn/facebook-signup-btn.071c597b.png',
'images/site/btn/google-login-btn.png': 'images/site/btn/google-login-btn.d8f30867.png',
'images/site/btn/google-signup-btn.png': 'images/site/btn/google-signup-btn.5df3ce2e.png'
}
If I could only figure out how to access cwd, I would push a patch myself.
@binarykitchen I'm assuming you're using this alongside usemin?
@ProLoser Usemin? Since I have no idea what usemin is, I guess I am not using usemin at all.
I can confirm this issue. +1
I think it had to be resolved with an option flag so it maintains backwards capability.
@binarykitchen@eddiemonge I think it should be better to add a basename option provide a map, with the key being the original basename, and the value being the revved basename. This option should be by default set to false. And maybe with could add an other option to specify a path, but I think it would go beyond the scope of filerev.
FYI there is the richardbolt/grunt-filerev-assets which should help you.
:+1: Not sure how people are using usemin + filerev with this issue