Open joebnb opened 10 months ago
https://github.com/vbenjs/vite-plugin-svg-icons/blob/7550357300793b96b3561fc708899b9f4309e906/packages/core/src/index.ts#L270C4-L270C38
用了FName 导致拿到的名称即使配置成
symbolId: '[name]',
也会永远存在 path
应该是
export function createSymbolId(name: string, options: ViteSvgIconsPlugin) { const { symbolId } = options if (!symbolId) { return name } let id = symbolId let fName = name const { fileName = '', dirName } = discreteDir(name) if (symbolId.includes('[dir]')) { id = id.replace(/\[dir\]/g, dirName) if (!dirName) { id = id.replace('--', '-') } fName = fileName } id = id.replace(/\[name\]/g, fileName) //这样的吧 return id.replace(path.extname(id), '') }
+1, html里面会显示全路径,
https://github.com/vbenjs/vite-plugin-svg-icons/blob/7550357300793b96b3561fc708899b9f4309e906/packages/core/src/index.ts#L270C4-L270C38
用了FName 导致拿到的名称即使配置成
symbolId: '[name]',
也会永远存在 path
应该是