Vite plugin to build icon fonts from SVG files using fantasticon. Current stable version 1.4.1, released sporadically. Supports single and multiple icon fonts with HMR via virtual imports. Generates CSS, TS constants, JSON metadata, and HTML preview. Differentiators: zero-config defaults, TypeScript types included, and built-in HMR for font assets.
npm install vite-plugin-fantasticonVerified import paths — ran on the pinned version, not inferred.
Shows minimal Vite config with fantasticon plugin and HMR import for icon font.
Use import 'fontasticon:icons' if font name is 'icons'.
Explicitly set inputDir in options to avoid confusion.
Use import syntax; set type: 'module' in package.json if needed.
Use // @ts-ignore if needed, or contribute types upstream.
Change to import statement: import fantasticon from 'vite-plugin-fantasticon'.
Set inputDir explicitly: fantasticon({ inputDir: 'my-icons' }).Ensure plugin is added in vite config and use exact font name: import 'fontasticon:<font-name>'.