Files
DECNET/decnet_web/src/lucide-icons.d.ts
anti c973ded2fc perf(web/icons): per-icon lucide imports via centralised alias
Route all lucide-react icon usage through a single src/icons.ts
re-export that imports each icon from its own per-icon module
(lucide-react/dist/esm/icons/<name>) instead of the barrel.

Bundle-size impact: none (29kB icons chunk unchanged — tree-shaking
was already effective with sideEffects:false). Dev-experience win:
Vite transforms 247 modules instead of 1848 because the dep
optimiser no longer pre-bundles the full lucide barrel — faster
cold start and HMR.

Ambient d.ts declares the wildcard module so TS accepts per-icon
imports; lucide ships .d.ts only for the barrel.

Seven icons were renamed upstream and still work through the barrel
via aliases (AlertTriangle -> triangle-alert, BarChart3 -> chart-column,
CheckCircle -> circle-check-big, Filter -> funnel, PlusCircle ->
circle-plus, Sliders -> sliders-vertical, UploadCloud -> cloud-upload,
Fingerprint -> fingerprint-pattern). Component call sites stay on
the legacy names; the renames live only in icons.ts.
2026-04-24 18:41:33 -04:00

17 lines
632 B
TypeScript

/* Ambient typings for lucide-react's per-icon module paths.
*
* lucide-react ships .d.ts only for the barrel entry point; the
* per-icon files (dist/esm/icons/<name>.js) have no sibling .d.ts.
* We import each icon from its own file to keep the dep-optimiser
* from pre-bundling the whole barrel, so the compiler needs a
* declaration that covers the wildcard path.
*
* Every icon exposes the same default-exported component shape,
* so one module wildcard is enough. */
declare module 'lucide-react/dist/esm/icons/*' {
import type { LucideIcon } from 'lucide-react';
const icon: LucideIcon;
export default icon;
}