mirror of
https://github.com/tabler/tabler.git
synced 2026-10-12 05:06:55 +04:00
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:
1 parent
f5551cd494
commit
b4b10f924a
2 files changed
+8
-2
No files matched your search
@@ -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.
|
||||||
@@ -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])
|
||||||
|
|||||||
Reference in new issue
Block a user