Render all icons on the preview icons page in production builds

- keep the 20-icon limit only for the dev server
This commit is contained in:
codecalm committed 2026-09-07 09:48:45 +02:00
1 parent f5551cd494
commit b4b10f924a
2 files changed
+8 -2

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
"@tabler/preview": patch
---
Fixed the preview icons page to render all icons in production builds, keeping the 20-icon limit only for the dev server.
+3 -2
View File
@@ -10,8 +10,9 @@ interface Props {
const { title, type = 'outline' } = Astro.props const { title, type = 'outline' } = Astro.props
// Dev preview limits icons to 20 (see BaseLayout). // The dev server renders only the first 20 icons so the page stays fast;
const limit = 20 // `astro build` (the zip package and production site) renders all of them.
const limit = import.meta.env.DEV ? 20 : Infinity
const entries = Object.entries(icons as Record<string, { svg?: Record<string, string | null> }>) const entries = Object.entries(icons as Record<string, { svg?: Record<string, string | null> }>)
.filter(([, icon]) => icon.svg?.[type]) .filter(([, icon]) => icon.svg?.[type])