{"id":27635704,"url":"https://github.com/thednp/vite-solid-svg","last_synced_at":"2026-04-02T17:57:41.296Z","repository":{"id":279028514,"uuid":"937528628","full_name":"thednp/vite-solid-svg","owner":"thednp","description":"A Vite plugin that transforms SVG files into SolidJS Components","archived":false,"fork":false,"pushed_at":"2026-03-26T18:05:06.000Z","size":119,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-27T06:44:31.517Z","etag":null,"topics":["solid-js","svg","vite"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/thednp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["thednp"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2025-02-23T09:29:21.000Z","updated_at":"2026-03-26T18:02:55.000Z","dependencies_parsed_at":"2025-02-23T09:39:01.834Z","dependency_job_id":"02beb137-c1da-44a5-a95a-fcc6d2416c8b","html_url":"https://github.com/thednp/vite-solid-svg","commit_stats":null,"previous_names":["thednp/vite-solid-svg"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/thednp/vite-solid-svg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thednp%2Fvite-solid-svg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thednp%2Fvite-solid-svg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thednp%2Fvite-solid-svg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thednp%2Fvite-solid-svg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thednp","download_url":"https://codeload.github.com/thednp/vite-solid-svg/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thednp%2Fvite-solid-svg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31312744,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["solid-js","svg","vite"],"created_at":"2025-04-23T20:11:19.240Z","updated_at":"2026-04-02T17:57:41.289Z","avatar_url":"https://github.com/thednp.png","language":"JavaScript","readme":"# vite-solid-svg\n\n[![Coverage Status](https://coveralls.io/repos/github/thednp/vite-solid-svg/badge.svg)](https://coveralls.io/github/thednp/vite-solid-svg)\n[![ci](https://github.com/thednp/vite-solid-svg/actions/workflows/ci.yml/badge.svg)](https://github.com/thednp/vite-solid-svg/actions/workflows/ci.yml)\n[![NPM Version](https://img.shields.io/npm/v/vite-solid-svg.svg)](https://www.npmjs.com/package/vite-solid-svg)\n\n\nA Vite plugin that transforms SVG files into SolidJS components using the [DOMParser](https://github.com/thednp/domparser).\nWhy this one? It's 3x faster than any SVGO powered plugin. Check the [React](https://github.com/thednp/vite-react-svg) version for more info.\n\n## Features\n* 🚀 Fast transformation using [DOMParser](https://github.com/thednp/domparser)\n* 🎯 TypeScript support\n* 🔧 Configurable transformation options\n* 🔥 Hot Module Replacement (HMR) support\n* ⚡ Vitest powered tests\n\n\n## Installation\n\n```bash\nnpm install -D vite-solid-svg\n```\n\n```bash\npnpm add -D vite-solid-svg\n```\n\n```bash\nyarn add -D vite-solid-svg\n```\n\n```bash\ndeno add npm:vite-solid-svg\n```\n\n```bash\nbun install vite-solid-svg\n```\n\n\n## Usage\n### Configuration\n```ts\n// vite.config.ts\nimport { defineConfig } from 'vite'\nimport solidSVG from 'vite-solid-svg'\n\nexport default defineConfig({\n  plugins: [\n    // other plugins\n    solidSVG({\n        // optional\n    })\n  ]\n})\n```\n\n### Options\nWhile the default options work just fine, for your convenience the plugin allows you to set them all:\n\n```ts\ninterface VitePluginSolidSvgOptions {\n  oxcOptions?: OxcOptions,\n  esbuildOptions?: EsbuildTransformOptions,\n  include?: string | RegExp | (string | RegExp)[]\n  exclude?: string | RegExp | (string | RegExp)[]\n}\n```\n* `oxcOptions`: additional oxc transformation options for `rolldown`;\n* `esbuildOptions`: **deprecated** [EsbuildTransformOptions](https://esbuild.github.io/api/#transform) esbuild will make sure the plugin will work seamless within the Vite ecosystem and provides some additional options;\n* `include`: filter option to **include** one or more RegExp for file IDs; the default value is `[\"**/*.svg?solid\"]`;\n* `exclude`: filter option to **exclude** one or more RegExp for file IDs.\n\n**Note** - If you modify or add more include filters and you're using Typescript, you should also define new global modules.\n\n\n### Typescript\nTo add typescript support, edit your `src/vite-env.d.ts` (or any global types you have set in your app) as follows:\n\n```ts\n/// \u003creference types=\"vite/client\" /\u003e\n/// \u003creference types=\"vite-solid-svg\" /\u003e\n```\n\n\n### In Your Code\n```ts\nimport Icon from './icon.svg?solid'\n\nconst app = () =\u003e {\n  return \u003cdiv\u003e\n    \u003cIcon\n      class='my-icon'\n      width={24} height={24}\n      style={{ fill: \"currentColor\" }}\n    /\u003e\n  \u003c/div\u003e\n}\n```\n**Notes**:\n * All properties present in the markup of your SVG files will be used as default values;\n * The `viewBox` and `xmlns` properties are somewhat required in order for the SVG to be rendered properly;\n * The plugin will also resolve SVG files from the `/public` folder or any valid `viteConfig.publicDir` option.\n\n\n## Acknowledgments\n* [vite-plugin-svgr](https://github.com/pd4d10/vite-plugin-svgr) - For inspiration on the plugin architecture.\n* [vite-react-svg](https://github.com/thednp/vite-react-svg) - For a React version.\n\n\n## License\n**vite-solid-svg** is released under [MIT License](LICENSE).\n","funding_links":["https://github.com/sponsors/thednp"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthednp%2Fvite-solid-svg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthednp%2Fvite-solid-svg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthednp%2Fvite-solid-svg/lists"}