ctf0 / laravel-mix-versionhash

Auto append hash to file instead of using virtual one
MIT License
61 stars 18 forks source link

exclude files from hashing #22

Closed ctf0 closed 1 year ago

ctf0 commented 4 years ago

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

Erutan409 commented 4 years ago

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

ctf0 commented 4 years ago

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

Erutan409 commented 4 years ago

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

ctf0 commented 4 years ago

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.

mhilland commented 4 years ago

+1

oppiansteve commented 4 years ago

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.