import { normalizePath, type Plugin, type ResolvedConfig } from 'vite';
import path from 'path';
import fs from 'fs';
import { optimize } from 'svgo';
const virtualModuleId = 'svg-merge-attributes';
/**
* Regex for matching attributes inside a tag
*/
const ATTR_REGEX = /([a-z0-9_-]+)="([^"]*)"/gim;
/**
* Regex for matching
*/
const SVG_USE_REGEX = /