UNPKG

@stephansama/vite-iconify-svgmap

Version:

Vite plugin for generating iconify svg sprite maps in memory

24 lines (23 loc) • 1.03 kB
import { t as Options } from "./type-S4YO472i.mjs"; import { Plugin } from "vite"; //#region src/index.d.ts declare const VIRTUAL_MODULE_ID = "virtual:iconify-svgmap"; /** * Vite plugin that turns iconify icons into svg sprite maps * * - `import href from "virtual:iconify-svgmap/<pack>/<icon>"` resolves at build * time and emits a content hashed `<pack>.svg` sprite through vite * - `import { getIcon } from "virtual:iconify-svgmap"` registers icons while * pages render; call {@link writeSprites} after rendering to write their * sprites (the `/astro` integration does this for you) */ declare function iconifySvgmap(options?: Options): Plugin; /** * Write sprites for every icon registered with `getIcon` into * `<outDirectory>/<dir>/<pack>.svg`. call this after all pages have rendered. * * @returns The paths of the written sprites */ declare function writeSprites(outDirectory: string | URL): Promise<string[]>; //#endregion export { type Options, VIRTUAL_MODULE_ID, iconifySvgmap as default, writeSprites };