natemoo-re / astro-icon

Inline and sprite-based SVGs in Astro made easy!
https://astroicon.dev
Other
1.01k stars 57 forks source link

Move "[astro-icon] No sprites found ..." warnings to debug level #71

Closed edv-ns closed 1 year ago

edv-ns commented 1 year ago

Context

It is therefore good to have deep insights what is going on inside astro-icon package, but it could be opted-out by default, and possible to opt-in when needed.

Currently astro-icon does console.log for warning: https://github.com/natemoo-re/astro-icon/blob/c0cc7a703a19ead8c17cdd8e5a8532b5c62405fc/packages/core/lib/context.ts#L23

Astro (and Vite) does a good job by utilising https://github.com/debug-js/debug package, so any debugging can be revealed with DEBUG=... variable.

During astro build we do get many occurencies of:

[astro-icon] No sprites found while rendering "..."

even though sprites are used in only one page in whole project. Getting so many messages seems simply excessive.

TODO

stramel commented 1 year ago

Thanks for the suggestion! We're actually entirely reworking this package in #87. This will address error messaging and move the package to build time rather than runtime.

stramel commented 1 year ago

Closing this as it isn't relevant for v1 and we're not interested in adding to the existing v0 code at this time.