laravel-mix-versionhash icon indicating copy to clipboard operation
laravel-mix-versionhash copied to clipboard

exclude files from hashing

Open ctf0 opened this issue 5 years ago • 6 comments

@Erutan409 what do u think if we add another option under the event listener

https://github.com/ctf0/laravel-mix-versionhash/blob/081b829f365d6aef7b319adc2b6e191804ec980c/src/index.js#L94

to allow excluding files from hashing ?

ctf0 avatar Oct 13 '19 17:10 ctf0

@ctf0 Yeah, that would probably help with not hashing the mix file, if you add a default or something like that. Or would you want to keep the event listener to keep that list of exclusions totally under control of the user without injecting hard global defaults for mix.js, for example?

Erutan409 avatar Oct 13 '19 17:10 Erutan409

the current solution stands, i meant i wanted to add an extra feature which i think is usable under the new method, something like

mix.versionHash({
     exclude: ['path/to/file/app.css']
})

so when the file is copied, processed, etc.., it doesnt get hashed when saved, so you get app.css instead of app.654asd.css

ctf0 avatar Oct 13 '19 17:10 ctf0

Do you already have a use case for it? Either way, I think it could be useful for some.

Erutan409 avatar Oct 13 '19 18:10 Erutan409

yeah, incase u want mix to handle file coping from some path to public but without hashing it otherwise the external package depending on this file wont work because of the incorrect file name.

ctf0 avatar Oct 13 '19 18:10 ctf0

+1

mhilland avatar Oct 30 '19 22:10 mhilland

For me, I'd like to exclude the versioning of the style.css file that Wordpress uses to identify themes, which has to be named style.css.

Although, that said, I'm only building from SASS so I can add a banner which includes the git tag in it.

oppiansteve avatar Jan 22 '20 16:01 oppiansteve