ctf0 / laravel-mix-versionhash

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

Sort the final manifest #40

Closed Akilez closed 3 years ago

Akilez commented 3 years ago

In order to prevent subsequent runs from changing the manifest in ordering only, I have added a similar-to-mix sorting to the file output.

ctf0 commented 3 years ago

can u plz elaborate more of what issue does this PR fix ? also can we do it without the extra lib ?

Akilez commented 3 years ago

When the json array is written to the manifest file it can and occasionally does have a different order to it. Thus, writing to the file make the manifest file show as changed in git repos. The overall list of files is the same, but listed in a new order.

This is very similar to a pull request two years ago with Laravel mix https://github.com/JeffreyWay/laravel-mix/pull/1342

Yes, we can do the same without the additional library. However as this is a Laravel Mix extension I opted to do it the same way that is currently used in Mix itself lines 27-29.

ctf0 commented 3 years ago

ok np, can u plz add it to peerDependecies for future-proofing ?

Akilez commented 3 years ago

Grr, apparently I'm dumb. Now it's done.

ctf0 commented 3 years ago

np, thanx again