{"id":22531951,"url":"https://github.com/yue1123/vite-plugin-data-url","last_synced_at":"2026-03-17T11:02:57.621Z","repository":{"id":163180696,"uuid":"637932198","full_name":"yue1123/vite-plugin-data-url","owner":"yue1123","description":"Extend vite import query to add data-url import. You can talk about importing the data-url encoding of a resource directly.","archived":false,"fork":false,"pushed_at":"2024-04-25T16:32:30.000Z","size":72,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-22T11:21:45.506Z","etag":null,"topics":["base64","data-url","image","import","import-data","query","vite","vite-plugin"],"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/yue1123.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},"funding":{"custom":"https://yue1123.github.io/vue3-baidu-map-gl/sponsor"}},"created_at":"2023-05-08T18:08:58.000Z","updated_at":"2024-04-25T16:32:35.000Z","dependencies_parsed_at":"2024-04-07T12:32:20.970Z","dependency_job_id":"124a797e-3434-4b2c-8394-a79ed7242020","html_url":"https://github.com/yue1123/vite-plugin-data-url","commit_stats":null,"previous_names":["yue1123/vite-plugin-data-url-query","yue1123/vite-plugin-data-url"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yue1123%2Fvite-plugin-data-url","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yue1123%2Fvite-plugin-data-url/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yue1123%2Fvite-plugin-data-url/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yue1123%2Fvite-plugin-data-url/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yue1123","download_url":"https://codeload.github.com/yue1123/vite-plugin-data-url/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247640466,"owners_count":20971558,"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":["base64","data-url","image","import","import-data","query","vite","vite-plugin"],"created_at":"2024-12-07T08:09:17.461Z","updated_at":"2026-03-17T11:02:52.583Z","avatar_url":"https://github.com/yue1123.png","language":"TypeScript","funding_links":["https://yue1123.github.io/vue3-baidu-map-gl/sponsor"],"categories":[],"sub_categories":[],"readme":"# vite-plugin-data-url\n\n![npm](https://img.shields.io/npm/v/vite-plugin-data-url-query?style=flat-square)\n![npm](https://img.shields.io/npm/dm/vite-plugin-data-url-query?style=flat-square)\n![GitHub](https://img.shields.io/github/license/yue1123/vite-plugin-data-url-query?style=flat-square)\n\nAdd support for data-url query import, you can directly import the data-url address of the image.\n\n## 📦 Install\n\n```shell\nnpm i vite-plugin-data-url -D\n\n# yarn\nyarn add vite-plugin-data-url -D\n\n# pnpm\npnpm add vite-plugin-data-url -D\n```\n\n## 🦄 Usage\n\nAdd envParse plugin to vite.config.js / vite.config.ts and configure it:\n\n```ts\n// vite.config.js / vite.config.ts\nimport { dataUrl } from 'vite-plugin-data-url'\n\nexport default {\n  plugins: [dataUrl()]\n}\n```\n\n## Typescript\n\nAdd types for `?data-url`\n\n```json\n\"complierOptions\":{\n  // ...\n  \"types\": [\"vite-plugin-data-url/types\"]\n  // ...\n}\n\n```\n\n## API\n\n### Base64ImportOptions\n\n| Property Name | Type      | Description                                                                                                                | Default Value |\n| ------------- | --------- | -------------------------------------------------------------------------------------------------------------------------- | ------------- |\n| sizeWarning   | `boolean` | Whether to disable the warning when specified files exceed the set size limit.                                             |  `true`          |\n| limit         | `number`  | The maximum file size (in KB) for converting to base64. If exceeded, a warning will be given and the file will be ignored. | `10 * 1024`   |\n\n## License\n\n[MIT licenses](https://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyue1123%2Fvite-plugin-data-url","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyue1123%2Fvite-plugin-data-url","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyue1123%2Fvite-plugin-data-url/lists"}