@stephansama/astro-iconify-svgmap
Version:
Astro integration for generating iconify svgmaps for ssg sites
21 lines (20 loc) • 852 B
JavaScript
import { i as defaultConfig, n as LOADED_ICONS_FILENAME, t as CONFIG_FILENAME } from "./const-BOIMW1to.mjs";
import { r as loadIcons, t as buildEnd } from "./utilities-C4Go8fep.mjs";
import * as fs$1 from "node:fs";
import path from "node:path";
import { parseArgs } from "node:util";
//#region src/cli.ts
const { values: { config } } = parseArgs({ options: { config: {
default: path.resolve(CONFIG_FILENAME),
short: "c",
type: "string"
} } });
const configFile = fs$1.readFileSync(config, { encoding: "utf8" });
const options = JSON.parse(configFile || "false") || defaultConfig;
const usage = JSON.parse(fs$1.readFileSync(path.resolve(LOADED_ICONS_FILENAME), { encoding: "utf8" }) || "{}");
loadIcons(options).then((data) => {
buildEnd(data, usage, options);
}).catch((error) => console.error(error));
//#endregion
export {};