{"id":16226198,"url":"https://github.com/antony/rollup-plugin-svg","last_synced_at":"2025-03-16T12:31:50.094Z","repository":{"id":48002854,"uuid":"91204217","full_name":"antony/rollup-plugin-svg","owner":"antony","description":"SVG Plugin for rollupjs","archived":false,"fork":false,"pushed_at":"2022-11-17T09:49:47.000Z","size":110,"stargazers_count":30,"open_issues_count":7,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-27T08:22:33.332Z","etag":null,"topics":["rollup","rollup-plugin-svg","svg"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/antony.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-13T21:37:31.000Z","updated_at":"2024-10-28T05:27:51.000Z","dependencies_parsed_at":"2023-01-22T18:46:08.946Z","dependency_job_id":null,"html_url":"https://github.com/antony/rollup-plugin-svg","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antony%2Frollup-plugin-svg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antony%2Frollup-plugin-svg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antony%2Frollup-plugin-svg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antony%2Frollup-plugin-svg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antony","download_url":"https://codeload.github.com/antony/rollup-plugin-svg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243814880,"owners_count":20352037,"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":["rollup","rollup-plugin-svg","svg"],"created_at":"2024-10-10T12:48:26.837Z","updated_at":"2025-03-16T12:31:49.780Z","avatar_url":"https://github.com/antony.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rollup-plugin-svg\n\nImport SVG files as base64, or as Markup\n\n[![CircleCI](https://circleci.com/gh/antony/github-backup.svg?style=shield)](https://circleci.com/gh/antony/rollup-plugin-svg) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\n## Installation\n\n```bash\nnpm i -D rollup-plugin-svg\n```\n\n## Usage\n\n```js\n// rollup.config.js\nimport svg from 'rollup-plugin-svg'\n\nexport default {\n  entry: 'src/input.js',\n  dest: 'dist/output.js',\n  plugins: [\n    svg()\n  ]\n}\n```\n\nYou can then use svgs in your bundle thusly:\n\n```js\nimport logo from './desirable-objects.svg'\n\n// Without base64:\ndocument.body.appendChild( logo )\n\n// With base64:\n\u003cimg src=\"{logo}\" alt=\"Whatever\" /\u003e\n```\n\n## Options:\n\n### base64\n\nDefaults to false.\n\nBas64 encoded SVGs will be 33% larger than the size on disk. You should therefore only use this for small images where the convenience of having them available on startup (e.g. rendering immediately to a canvas without co-ordinating asynchronous loading of several images) outweighs the cost.\n\n## Sources\n\nThis plugin was built (based on the rollup-plugin-image plugin) because it appears that the two existing suitable plugins:\n\n[rollup-plugin-image](https://github.com/rollup/rollup-plugin-image)\n[rollup-plugin-url](https://github.com/rollup/rollup-plugin-url)\n\ndon't seem to work any more. I wanted a simple solution to provide SVG images to [Vudash](http://www.vudash.com)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantony%2Frollup-plugin-svg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantony%2Frollup-plugin-svg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantony%2Frollup-plugin-svg/lists"}