{"id":13774147,"url":"https://github.com/e-e-e/rollup-plugin-vue-inline-svg","last_synced_at":"2025-05-01T18:30:39.356Z","repository":{"id":42942257,"uuid":"102247750","full_name":"e-e-e/rollup-plugin-vue-inline-svg","owner":"e-e-e","description":"rollup plugin to convert svg files to optimised vue components","archived":false,"fork":false,"pushed_at":"2023-03-04T05:42:53.000Z","size":549,"stargazers_count":15,"open_issues_count":7,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-02-15T09:32:18.396Z","etag":null,"topics":[],"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/e-e-e.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-09-03T07:18:23.000Z","updated_at":"2023-09-27T08:28:07.000Z","dependencies_parsed_at":"2024-01-13T11:57:45.353Z","dependency_job_id":"e058ffa1-de3c-4c9d-9d4b-098f88f533af","html_url":"https://github.com/e-e-e/rollup-plugin-vue-inline-svg","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e-e-e%2Frollup-plugin-vue-inline-svg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e-e-e%2Frollup-plugin-vue-inline-svg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e-e-e%2Frollup-plugin-vue-inline-svg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e-e-e%2Frollup-plugin-vue-inline-svg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/e-e-e","download_url":"https://codeload.github.com/e-e-e/rollup-plugin-vue-inline-svg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251924592,"owners_count":21665998,"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":[],"created_at":"2024-08-03T17:01:24.123Z","updated_at":"2025-05-01T18:30:38.965Z","avatar_url":"https://github.com/e-e-e.png","language":"JavaScript","readme":"# rollup-plugin-vue-inline-svg\n[![Unit tests](https://github.com/e-e-e/rollup-plugin-vue-inline-svg/actions/workflows/tests.yml/badge.svg)](https://github.com/e-e-e/rollup-plugin-vue-inline-svg/actions/workflows/tests.yml)\n\nA simple plugin to import svg files as vue components. This is intended to be used with [rollup-plugin-vue](https://www.npmjs.com/package/rollup-plugin-vue) and is based on [vue-svg-loader](https://www.npmjs.com/package/vue-svg-loader).\n\n## installation\n\n```sh\nnpm install --save-dev rollup-plugin-vue-inline-svg\n```\n\n## usage\n\n**rollup.config.js**\n```js\nimport svg from 'rollup-plugin-vue-inline-svg';\nimport vue from 'rollup-plugin-vue'; // optional\n\nexport default {\n  // ...\n  plugins: [\n    svg(config)\n    vue(), // optional\n  ]\n}\n```\n\n### config\n\nBy default this plugin will attempt to transform all files that end with the extension `.svg`.\nYou can be more explicit by passing include and exclude options.\n\n```js\n// `include` and `exclude` can each be a minimatch\n// pattern, or an array of minimatch patterns, relative to process.cwd()\n{\n  include: string or array of minimatch,\n  exclude: string or array,\n  svgoConfig: svgo config object,\n}\n```\n\nSee [SVGO](https://github.com/svg/svgo) for configuration options that it accepts.\n\n### Import svgs from `node_modules`\n\nThe plugin is able to import svg files from `node_modules` packages:\n\n```js\nimport AlertSvg from 'octicons/build/svg/alert.svg'\n```\n\nThe only important thing to remember is that the **rollup build process needs to be started from the project root directory** (e.g. via npm scripts). This is because the plugin will search the `node_modules` directory, via the `process.cwd()` [node method](https://nodejs.org/api/process.html#process_process_cwd), from where the process has started.\n","funding_links":[],"categories":["Plugins"],"sub_categories":["Frameworks"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fe-e-e%2Frollup-plugin-vue-inline-svg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fe-e-e%2Frollup-plugin-vue-inline-svg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fe-e-e%2Frollup-plugin-vue-inline-svg/lists"}