natemoo-re / astro-icon

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

[v1] Verbose logging? #166

Open fflaten opened 6 months ago

fflaten commented 6 months ago

Consider adding duration astro-icon logs and maybe similar loaded-event for local icons. Just wasted some time attempting to optimize icon collections because it looked like astro-icon used multiple seconds. In reality it only added 0.5sec.

With astro-icon and components

11:21:06 Types generated 273ms
11:21:06 [build] output: "static"
11:21:06 [build] directory: /workspaces/Website/dist/
11:21:06 [build] Collecting build info...
11:21:06 [build] ✓ Completed in 413ms.
11:21:06 [build] Building static entrypoints...
11:21:11 [astro-icon] Loaded icons from carbon
11:21:13 [build] ✓ Completed in 6.68s.

Without

11:49:55 [build] output: "static"
11:49:55 [build] directory: /workspaces/Website/dist/
11:49:55 [build] Collecting build info...
11:49:55 [build] ✓ Completed in 375ms.
11:49:55 [build] Building static entrypoints...
11:50:01 [build] ✓ Completed in 6.12s.
natemoo-re commented 5 months ago

I'm not sure if there's much to be done from the integration's side here. Maybe we can update the message itself, but we're only logging once after loading all the icons. The rest is just Astro building the project.

Maybe we should log ✓ Loaded icons in 500ms.?

fflaten commented 5 months ago

Maybe we should log ✓ Loaded icons in 500ms.?

Not critical but I'd personally prefer it.