{"id":20106720,"url":"https://github.com/mini-ghost/unplugin-svg-loader","last_synced_at":"2026-06-24T21:31:05.818Z","repository":{"id":261264644,"uuid":"883783856","full_name":"Mini-ghost/unplugin-svg-loader","owner":"Mini-ghost","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-05T15:21:43.000Z","size":83,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-26T04:39:36.350Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Mini-ghost.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-05T15:07:57.000Z","updated_at":"2024-11-05T15:25:38.000Z","dependencies_parsed_at":"2024-11-05T16:40:37.252Z","dependency_job_id":"d45c5c65-3b95-45cd-a0fd-771ab60764fc","html_url":"https://github.com/Mini-ghost/unplugin-svg-loader","commit_stats":null,"previous_names":["mini-ghost/unplugin-svg-loader"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Mini-ghost/unplugin-svg-loader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mini-ghost%2Funplugin-svg-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mini-ghost%2Funplugin-svg-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mini-ghost%2Funplugin-svg-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mini-ghost%2Funplugin-svg-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mini-ghost","download_url":"https://codeload.github.com/Mini-ghost/unplugin-svg-loader/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mini-ghost%2Funplugin-svg-loader/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34750952,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-24T02:00:07.484Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T17:54:30.709Z","updated_at":"2026-06-24T21:31:05.782Z","avatar_url":"https://github.com/Mini-ghost.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @mini-ghost/unplugin-svg-loader\n\nAn unplugin that supports converting SVGs to base64 or extracting paths.\n\n## Installation\n\n```bash\nnpm i @mini-ghost/unplugin-svg-loader\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eVite\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// vite.config.ts\nimport SvgLoader from '@mini-ghost/unplugin-svg-loader/vite'\n\nexport default defineConfig({\n  plugins: [\n    SvgLoader(),\n  ],\n})\n```\n\nExample: [`playground/`](./playground/)\n\n\u003cbr\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eRollup\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// rollup.config.js\nimport SvgLoader from '@mini-ghost/unplugin-svg-loader/rollup'\n\nexport default {\n  plugins: [\n    SvgLoader(),\n  ],\n}\n```\n\n\u003cbr\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eWebpack\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// webpack.config.js\nmodule.exports = {\n  /* ... */\n  plugins: [\n    require('@mini-ghost/unplugin-svg-loader/webpack')()\n  ]\n}\n```\n\n\u003cbr\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eVue CLI\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// vue.config.js\nmodule.exports = {\n  configureWebpack: {\n    plugins: [\n      require('@mini-ghost/unplugin-svg-loader/webpack')(),\n    ],\n  },\n}\n```\n\n\u003cbr\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eesbuild\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// esbuild.config.js\nimport { build } from 'esbuild'\nimport SvgLoader from '@mini-ghost/unplugin-svg-loader/esbuild'\n\nbuild({\n  plugins: [SvgLoader()],\n})\n```\n\n\u003cbr\u003e\u003c/details\u003e\n\n## Usage\n\n### Base64\n\n```ts\nimport unpluginBase64 from './assets/unplugin.svg?base64'\n// 'data:image/svg+xml;base64,...'\n```\n\n### Path\n\n```ts\nimport unpluginPath from './assets/unplugin.svg?path'\n// 'M256 0H0V256H256V0Z M72.9779 273.931L73.3264...'\n```\n\n`*.svg?path` is very useful for allowing Echarts to use some simple icons.\n\n```ts\nimport simpleIconPath from './assets/simple.svg?path'\n\nconst legend = {\n  data: [\n    { name: 'unplugin', icon: `path://${simpleIconPath}` },\n    // ...\n  ]\n}\n```\n\n## License\n\n[MIT](./LICENSE) License © 2024-PRESENT [Alex Liu](https://github.com/Mini-ghost)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmini-ghost%2Funplugin-svg-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmini-ghost%2Funplugin-svg-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmini-ghost%2Funplugin-svg-loader/lists"}