feat-agency / vite-plugin-webfont-dl

⚡ Webfont Download Vite Plugin - Make your Vite site load faster
MIT License
302 stars 11 forks source link

Disable logging for cached fonts #41

Closed Radiergummi closed 11 months ago

Radiergummi commented 11 months ago

Currently, the plugin will write a line to the log every time it serves a font - even if it will be fetched from the file cache. This feels a bit verbose in my opinion. I'd like to suggest only logging the first time a webfont file is fetched from its origin, and maybe introduce debug logging with more specific log messages.
Would you accept a PR that achieves this?

0xb4lint commented 11 months ago

Thanks for raising this issue @Radiergummi!

That line should be just a flash and it should clear the line after 500ms.

Anyway, I've moved the flashLine() call after the cache check, so it should be called only if download starting.

Just released v3.8.0!

Radiergummi commented 11 months ago

I'm running Vite in a container, where the output is appended to a log, thus clearing doesn't work - but it's good to know!

Anyway, that's awesome, thank you for the quick fix!