make-icon-data

Ingests SVG files from icon directories and generates an icon-data module (TypeScript or JavaScript). This is the build tool behind the icons system.

Usage

bun run bin/make-icon-data.js [options]

Options

Examples

bun run bin/make-icon-data.js
bun run bin/make-icon-data.js --input ./my-icons --output ./dist/icons.js
bun run bin/make-icon-data.js --optimize false

Directory conventions

Style classes

Folder names control CSS classes on the generated SVGs:

Directional folders

Place icons in specially named folders to auto-generate directional redirects, eliminating redundant SVG files:

For example, chevron-right.svg in an up-down-right-left/ folder produces chevronRight (SVG) plus chevronDown, chevronLeft, chevronUp (redirects).

Comma-separated names

For icons where the directional variant has a different name (not just a direction swap), use commas in the filename:

skip-forward,skip-back.svg    → skipForward (SVG) + skipBack (redirect)
refresh-cw,refresh-ccw.svg    → refreshCw (SVG) + refreshCcw (redirect)

The first name is the base, additional names are mapped to the folder's variant suffixes in order.

SVG processing

The tool automatically: