{"id":18296246,"url":"https://github.com/ruanyl/esbuild-plugin-react-svgr","last_synced_at":"2025-07-14T13:12:58.834Z","repository":{"id":58413892,"uuid":"530840082","full_name":"ruanyl/esbuild-plugin-react-svgr","owner":"ruanyl","description":"esbuild plugin for react svgr","archived":false,"fork":false,"pushed_at":"2022-08-31T19:23:06.000Z","size":288,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-15T04:03:30.597Z","etag":null,"topics":["esbuild","react","svgr"],"latest_commit_sha":null,"homepage":"","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/ruanyl.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-30T21:39:14.000Z","updated_at":"2022-09-01T18:41:28.000Z","dependencies_parsed_at":"2022-09-16T00:52:06.606Z","dependency_job_id":null,"html_url":"https://github.com/ruanyl/esbuild-plugin-react-svgr","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruanyl%2Fesbuild-plugin-react-svgr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruanyl%2Fesbuild-plugin-react-svgr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruanyl%2Fesbuild-plugin-react-svgr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruanyl%2Fesbuild-plugin-react-svgr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ruanyl","download_url":"https://codeload.github.com/ruanyl/esbuild-plugin-react-svgr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248008551,"owners_count":21032553,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["esbuild","react","svgr"],"created_at":"2024-11-05T14:39:58.945Z","updated_at":"2025-04-09T08:42:53.046Z","avatar_url":"https://github.com/ruanyl.png","language":"TypeScript","readme":"# esbuild-plugin-svgr\n\n### Install\n```\npnpm add esbuild-plugin-react-svgr -D\n```\n\n### Usage\n\n```typescript\nimport { build } from 'esbuild'\n\nbuild({\n  entryPoints: ['./logo.svg'],\n  plugins: [svgrPlugin()],\n  outdir: 'dist',\n})\n// Output ==============\u003e\nimport * as React from \"react\";\nconst SvgLogo = (props) =\u003e /* @__PURE__ */ React.createElement(\"svg\", {...});\nexport default SvgLogo;\n```\n\nBuild with svgr options\n\n```typescript\nimport { build } from 'esbuild'\n\nbuild({\n  entryPoints: ['./logo.svg'],\n  plugins: [svgrPlugin({exportType: 'named'})],\n  outdir: 'dist',\n})\n\n// Output ==============\u003e\nimport * as React from \"react\";\nconst SvgLogo = (props) =\u003e /* @__PURE__ */ React.createElement(\"svg\", {...});\nexport { SvgLogo as ReactComponent };\n```\n\nEnable url export:\n```typescript\n// index.ts\nimport url, { ReactComponent } from './logo.svg'\n```\n\n```typescript\nimport { build } from 'esbuild'\n\nbuild({\n  entryPoints: ['./index.ts'],\n  plugins: [svgrPlugin({}, {exportUrl: true})],\n  outdir: 'dist',\n  bundle: true,\n  loader: {\n    '.svg': 'file',\n  },\n})\n\n// Output ==============\u003e\n// logo.svg\nvar logo_default = \"./logo-4YCDN2WN.svg\";\n\n\n// svgr:/Users/yulongruan/project/esbuild-plugin-svgr/src/__test__/fixtures/logo.svg\nvar React = __toESM(__require(\"react\"));\nvar SvgLogo = (props) =\u003e /* @__PURE__ */ React.createElement(\"svg\", {...});\n\nvar logo_default2 = logo_default;\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruanyl%2Fesbuild-plugin-react-svgr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruanyl%2Fesbuild-plugin-react-svgr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruanyl%2Fesbuild-plugin-react-svgr/lists"}