{"id":13606132,"url":"https://github.com/tomjs/vite-plugin-iconify","last_synced_at":"2025-10-25T23:02:31.692Z","repository":{"id":206237321,"uuid":"716161741","full_name":"tomjs/vite-plugin-iconify","owner":"tomjs","description":"A Vite plugin for handling iconify icon sets in environments without internet access.","archived":false,"fork":false,"pushed_at":"2025-05-24T17:06:02.000Z","size":1100,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-05T16:44:46.868Z","etag":null,"topics":["cdn","iconify","local","plugin","vite"],"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/tomjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null}},"created_at":"2023-11-08T15:08:26.000Z","updated_at":"2025-06-14T19:48:48.000Z","dependencies_parsed_at":"2023-12-21T13:10:41.896Z","dependency_job_id":"88b266bc-6fed-4064-b631-21e2bd4cfc22","html_url":"https://github.com/tomjs/vite-plugin-iconify","commit_stats":{"total_commits":38,"total_committers":1,"mean_commits":38.0,"dds":0.0,"last_synced_commit":"dc9f955f1e973a1e2862160184a93897e2fe7b48"},"previous_names":["tomgao365/vite-plugin-iconify","tomjs/vite-plugin-iconify"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/tomjs/vite-plugin-iconify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomjs%2Fvite-plugin-iconify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomjs%2Fvite-plugin-iconify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomjs%2Fvite-plugin-iconify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomjs%2Fvite-plugin-iconify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomjs","download_url":"https://codeload.github.com/tomjs/vite-plugin-iconify/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomjs%2Fvite-plugin-iconify/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264940379,"owners_count":23686242,"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":["cdn","iconify","local","plugin","vite"],"created_at":"2024-08-01T19:01:06.372Z","updated_at":"2025-10-25T23:02:31.639Z","avatar_url":"https://github.com/tomjs.png","language":"TypeScript","funding_links":[],"categories":["Plugins"],"sub_categories":["Framework-agnostic Plugins"],"readme":"# @tomjs/vite-plugin-iconify\n\n[![npm](https://img.shields.io/npm/v/@tomjs/vite-plugin-iconify)](https://www.npmjs.com/package/@tomjs/vite-plugin-iconify) ![node-current (scoped)](https://img.shields.io/node/v/@tomjs/vite-plugin-iconify) ![NPM](https://img.shields.io/npm/l/@tomjs/vite-plugin-iconify) [![Docs](https://img.shields.io/badge/API-unpkg-orange)](https://www.unpkg.com/browse/@tomjs/vite-plugin-iconify/dist/index.d.ts)\n\n**English** | [中文](./README.zh_CN.md)\n\n\u003e A Vite plugin for handling iconify icon sets in environments without internet access.\n\n## Install\n\n```bash\n# pnpm\npnpm add @iconify/json @tomjs/vite-plugin-iconify -D\n\n# yarn\nyarn add @iconify/json @tomjs/vite-plugin-iconify -D\n\n# npm\nnpm i @iconify/json @tomjs/vite-plugin-iconify --save-dev\n```\n\n## Usage\n\nUsing Vue/React projects as examples:\n\n### Using the plugin\n\n#### Vue Example\n\n```js\nimport iconify from '@tomjs/vite-plugin-iconify';\nimport vue from '@vitejs/plugin-vue';\nimport { defineConfig } from 'vite';\n\nexport default defineConfig({\n  plugins: [\n    vue(),\n    iconify({\n      resources: ['https://unpkg.com/@iconify/json/json'],\n      rotate: 3000,\n      local: ['ant-design', 'ep'],\n    }),\n  ],\n});\n```\n\n#### React Example\n\n```js\nimport iconify from '@tomjs/vite-plugin-iconify';\nimport react from '@vitejs/plugin-react-swc';\nimport { defineConfig } from 'vite';\n\nexport default defineConfig({\n  plugins: [\n    react(),\n    iconify({\n      resources: ['https://unpkg.com/@iconify/json/json'],\n      rotate: 3000,\n      local: ['ant-design', 'ep'],\n    }),\n  ],\n});\n```\n\n#### Documentation\n\n- [index.d.ts](https://www.unpkg.com/browse/@tomjs/vite-plugin-iconify/dist/index.d.ts) provided by [unpkg.com](https://www.unpkg.com).\n\n#### Parameters\n\n| Parameter | Type                                        | Default | Description                                                      |\n| --------- | ------------------------------------------- | ------- | ---------------------------------------------------------------- |\n| selector  | `string`                                    | 'title' | The tag selector to inject the IconifyProviders script after     |\n| resources | `string[]`                                  | []      | Icon API URLs, default includes https://api.iconify.design       |\n| rotate    | `number`                                    | 750     | Timeout in milliseconds before using the next host               |\n| timeout   | `number`                                    | 5000    | Timeout in milliseconds before an API query is considered failed |\n| local     | `'boolean'\\|'IconifySet[]'\\|IconifyLocal[]` | false   | Local icon set configuration                                     |\n\n**resources**: You can add npm cdn or custom url:\n\n- npmmirror:\n  - https://registry.npmmirror.com/@iconify/json/{version}/files/json\n  - https://registry.npmmirror.com/@iconify/json/latest/files/json\n  - https://registry.npmmirror.com/@iconify/json/2.2.187/files/json\n- jsdelivr:\n  - https://cdn.jsdelivr.net/npm/@iconify/json@{version}/json\n  - https://cdn.jsdelivr.net/npm/@iconify/json/json\n  - https://cdn.jsdelivr.net/npm/@iconify/json@2.2.187/json\n- unpkg:\n  - https://unpkg.com/@iconify/json@{version}/json\n  - https://unpkg.com/@iconify/json/json\n  - https://unpkg.com/@iconify/json@2.2.187/json\n\n##### IconifySet\n\nIconify icon set, refer to [icon sets](https://icon-sets.iconify.design/) or [Icônes](https://icones.js.org/)\n\n##### IconifyLocal\n\nBy configuring this parameter, the local icon set will be copied to the `outDir` directory based on the `sets` configuration.\n\n| Parameter | Type           | Default                       | Description                                                                                    |\n| --------- | -------------- | ----------------------------- | ---------------------------------------------------------------------------------------------- |\n| **sets**  | `IconifySet[]` | []                            | Iconify icon sets                                                                              |\n| base      | `string`       | '/'                           | Same as the `base` option in Vite configuration                                                |\n| outDir    | `string`       | 'dist'                        | Local output directory, default is the same as the `build.outDir` option in Vite configuration |\n| path      | `string`       | 'npm/@iconify/json@{version}' | Local output path, the corresponding module URL will also be replaced with this path           |\n\n### Using CLI\n\nGenerate Iconify icon set data for icon selection and other functionalities.\n\n- Add the following script to `package.json` under `scripts` : `ti ant-design ep --path src/constants`\n- Or run the following command directly: `pnpm ti ant-design ep --path src/constants`\n\n```bash\nUsage:\n  $ ti [...sets]\n\nCommands:\n  [...sets]  create icon collection data based on @iconify/json in the project\n\nFor more info, run any command with the `--help` flag:\n  $ ti --help\n\nOptions:\n  --path \u003cpath\u003e  [string] output file path. (default: src)\n  --name \u003cname\u003e  [string] output file name. if tsconfig is exists, default is 'iconify.ts', or is 'iconify.js'\n  --type \u003ctype\u003e  [\"esm\" | \"cjs\"] output file type. (default: esm)\n  -h, --help     Display this message\n  -v, --version  Display version number\n```\n\n## Development\n\n- Development requirements:\n\n  - git\n  - node\u003e=16\n  - pnpm\u003e=8\n\n- For the first time, install dependencies by running the following command:\n\n```bash\n# Install dependencies\npnpm i\n# build library\npnpm build\n```\n\n- To debug the `vue` project, execute the following commands:\n\n```bash\ncd examples/vue\npnpm build\npnpm preview\n```\n\n- To debug the `react` project, execute the following commands:\n\n```bash\ncd examples/react\npnpm build\npnpm preview\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomjs%2Fvite-plugin-iconify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomjs%2Fvite-plugin-iconify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomjs%2Fvite-plugin-iconify/lists"}