Skip to content

v0.5.0

  • v0.5.0
  • c0a9333
  • Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
  • Choose a tag to compare

  • v0.5.0
  • c0a9333
  • Choose a tag to compare

  • Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
@Avijit07x Avijit07x tagged this 05 Sep 06:56
The ESM build bundled all 542 icons into a single dist/lucide.js. Since
sideEffects: false is a module-level flag, a lone module gave bundlers
nothing to drop - every icon is a forwardRef() call plus a top-level
displayName assignment, which no bundler removes from inside one module.
Importing one icon cost 809 kB / 86 kB gzip, the same as importing all 509.

ESM now emits dist/icons/<lib>/<name>.js per icon plus a shared motion
chunk. CJS stays bundled; require consumers do not tree-shake and per-icon
CJS would inline the motion runtime into every file.

Next's App Router needs more: the barrels carry "use client", making them a
client boundary it cannot shake through, so ./lucide/* and ./huge/* subpath
exports (with generated .d.ts) let Next users import an icon directly.

Measured, one icon: 809 kB -> 72 kB raw, 86 kB -> 26 kB gzip (esbuild);
918 kB -> 71 kB client JS in a Next 16 production build.

Also fixes the "use client" injector, which was silently not running from
tsup's onSuccess hook, and backfills 5 missing CHANGELOG entries.
Assets 2
Loading