Skip to content
This repository has been archived by the owner on Mar 26, 2018. It is now read-only.

Wrong paths in grunt.filerev.summary when a cwd was defined #15

Open
binarykitchen opened this issue Dec 20, 2013 · 7 comments · May be fixed by #60
Open

Wrong paths in grunt.filerev.summary when a cwd was defined #15

binarykitchen opened this issue Dec 20, 2013 · 7 comments · May be fixed by #60
Labels

Comments

@binarykitchen
Copy link

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'
}
@ProLoser
Copy link

ProLoser commented Feb 5, 2014

If I could only figure out how to access cwd, I would push a patch myself.

@ProLoser
Copy link

ProLoser commented Feb 5, 2014

@binarykitchen I'm assuming you're using this alongside usemin?

@binarykitchen
Copy link
Author

@ProLoser Usemin? Since I have no idea what usemin is, I guess I am not using usemin at all.

@cemo
Copy link

cemo commented May 24, 2014

I can confirm this issue. +1

@eddiemonge eddiemonge added the bug label Aug 7, 2014
sladex pushed a commit to sladex/grunt-filerev that referenced this issue Sep 9, 2014
@sladex
Copy link

sladex commented Sep 9, 2014

I think it had to be resolved with an option flag so it maintains backwards capability.

@stephanebachelier
Copy link
Contributor

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

@stephanebachelier stephanebachelier linked a pull request Oct 27, 2014 that will close this issue
@fenduru
Copy link

fenduru commented Dec 6, 2014

👍 Not sure how people are using usemin + filerev with this issue

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants