Denperidge / eleventy-auto-cache-buster

An Eleventy content-hash based cache buster, not requiring any filters or code changes aside from enabling the plugin!
https://www.npmjs.com/package/eleventy-auto-cache-buster
MIT License
9 stars 0 forks source link

add option for synchronous running #9

Closed sjml closed 1 month ago

sjml commented 1 month ago

This is what I mentioned in #8... a little ham-fisted, but shows how little has to change to make it work. Only a few async functions were actually being called, so it was just a matter of swapping them out for their sync brethren and changing the error handling a bit.

Looks like more of a change than it is because it necessarily throws everything behind an if statement, which changes all the whitespace. It does involve a lot of repetition, which is irritating at the least. But eliminating that would mean kind of restructuring the whole thing, which I was hesitant to do. Anyway, let me know what you think!

Denperidge commented 1 month ago

Gotcha, nice work! If it’s okay with you, I might either pull & adapt or make a new commit with you listed as co-author, so that I can in one go do the necessary restructuring to limit code repeat

sjml commented 1 month ago

Oh yeah, absolutely. Like I said, it's a bit ham-fisted. (Now that I think of it, I should have done it as a few separate commits so it was easier to see the changes, but alas.) Do with it what you will! Thanks for your openness.

Denperidge commented 1 month ago

Closing this PR, thank you for the help!