UNPKG

@kalimahapps/vue-icons

Version:

70,000+ SVG icons of popular icon sets that you can add seamlessly to vue projects

26 lines (25 loc) 863 B
import parseVueFiles from './parse-vue-files.js'; import parseTsFiles from './parse-ts-files.js'; const vitePluginVueIcons = function () { return { name: 'vite-plugin-vue-icons', enforce: 'pre', transform(code, id) { if (id.endsWith('.vue')) { const magicString = parseVueFiles(code); return { code: magicString.toString(), map: magicString.generateMap({ hires: true }), }; } if (id.endsWith('.ts') || id.endsWith('.js')) { const magicString = parseTsFiles(code); return { code: magicString.toString(), map: magicString.generateMap({ hires: true }), }; } }, }; }; export default vitePluginVueIcons;