Luismahou / grunt-hashres

Hashes your js and css files and rename the <script> and <link> declarations that refer to them in your html/php/etc files.
MIT License
115 stars 41 forks source link

Feature request: tweak hash file name pattern #1

Closed yellowled closed 12 years ago

yellowled commented 12 years ago

First of all: thanks a lot for building this. This works way, way better already than any similar solution I've come across. :-)

Just one thing to make it perfect (for me): I'd like to be able to tweak the pattern for the filenames generated. As of now, it's hash.original.cache.ext; personally, I'd prefer to use just hash.ext.

(I like short filenames in production. Other than that, our workflows seem pretty similar.)

Luismahou commented 12 years ago

Good point. Actually it was on my agenda to add the ability to set a suffix for the filenames, being 'cache' the default one. Would something like that be enough for you?

yellowled commented 12 years ago

Hm, that would give me something like hash.original.ext (if the suffix can also be empty), right?

Basically, this is not “important” at all. I could just as well live with the current filenames, I just think the 'cache' part is redundant – unless there's an actual reason for that? Also (again: not important, I'm just being quirky here), I'd prefer original-hash.ext. I don't have a technical reason for that, I just think it looks better. :-)

If this is not worthy the effort or unnecessary bloat in the plugin, never mind. After all, it's purely cosmetic.

Luismahou commented 12 years ago

Sorry, I haven't read properly your first message.

What do you think about adding a new configuration option called: 'fileNamePattern'. The default value would be '${hash}.${name}.cache.${extension}'. In your case, you'll need to configure it to '${hash}.${extension}'.

'.cache' is something that I stole from GWT. The idea is that all the files that contains '.cache.*' can be cached forever, making it easy to set up the Apache/Nginx/etc cache rules.

On Tue, Nov 6, 2012 at 2:31 PM, Matthias Mees notifications@github.comwrote:

Hm, that would give me something like hash.original.ext (if the suffix can also be empty), right?

Basically, this is not “important” at all. I could just as well live with the current filenames, I just think the 'cache' part is redundant – unless there's an actual reason for that? Also (again: not important, I'm just being quirky here), I'd prefer original-hash.ext. I don't have a technical reason for that, I just think it looks better. :-)

If this is not worthy the effort or unnecessary bloat in the plugin, never mind. After all, it's purely cosmetic.

— Reply to this email directly or view it on GitHubhttps://github.com/Luismahou/grunt-hashres/issues/1#issuecomment-10098073.

yellowled commented 12 years ago

Maximum flexibility combined with maximum backwards compatibility. Sounds perfect to me. :-)

Luismahou commented 12 years ago

Implemented on version 0.1.4