UNPKG

@stephansama/vite-iconify-svgmap

Version:

Vite plugin for generating iconify svg sprite maps in memory

23 lines (22 loc) • 701 B
import { n as iconifySvgmap, o as name, r as writeSprites } from "../src-CsllISxW.mjs"; //#region src/astro.ts /** * Astro integration that adds the vite plugin and writes sprites for icons * registered with `getIcon` once every page has been rendered */ function iconifySvgmapIntegration(options = {}) { return { name, hooks: { async "astro:build:done"({ dir, logger }) { const written = await writeSprites(dir); if (written.length > 0) logger.info(`wrote ${written.length} svg sprite(s)`); }, "astro:config:setup"({ updateConfig }) { updateConfig({ vite: { plugins: [iconifySvgmap(options)] } }); } } }; } //#endregion export { iconifySvgmapIntegration as default };