Menu

1 / 2

Our icon package is 90 MB of node_modules, and I measured exactly which ten of its 5,478 icons reach the homepage

DEV Community: react·Daniel Pertu·about 16 hours ago
#CzPfANb0
#devtoreact#devto#dev#icons#fullscreen
Reading 0:00
15s threshold

CogniPrep imports icons from @hugeicons/core-free-icons . Installed, that one package is:

du -sh node_modules/.pnpm/@[email protected]/node_modules/@hugeicons/core-free-icons # 90M (29M cjs, 60M esm, 664K types)

ls node_modules/.pnpm/@[email protected]/.../dist/esm | wc -l # 10957 (5,478 icon modules, plus a .map for each, plus the index)

Enter fullscreen mode

Exit fullscreen mode

Nine percent of a 1.0 GB node_modules , for pictures. The two index files tell you how the package expects to be consumed:

File Bytes What is in it

dist/esm/index.js 617,945 5,473 lines of pure re-export, one module per icon

dist/cjs/index.js 6,508,748 every icon, inlined into one module

package.json says "sideEffects": false , each icon is its own ESM module, and each icon array is exported under several names.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.