{"id":22428315,"url":"https://github.com/momsfriendlydevco/vite-plugin-inject","last_synced_at":"2026-02-04T01:04:24.480Z","repository":{"id":226141542,"uuid":"767871942","full_name":"MomsFriendlyDevCo/vite-plugin-inject","owner":"MomsFriendlyDevCo","description":"Inject files into Vite output","archived":false,"fork":false,"pushed_at":"2024-08-01T00:58:08.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-30T14:51:49.651Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MomsFriendlyDevCo.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2024-03-06T03:31:43.000Z","updated_at":"2024-08-01T00:58:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"c2367703-310c-40a8-8f07-40569c9f2256","html_url":"https://github.com/MomsFriendlyDevCo/vite-plugin-inject","commit_stats":null,"previous_names":["momsfriendlydevco/vite-plugin-inject"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MomsFriendlyDevCo/vite-plugin-inject","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MomsFriendlyDevCo%2Fvite-plugin-inject","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MomsFriendlyDevCo%2Fvite-plugin-inject/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MomsFriendlyDevCo%2Fvite-plugin-inject/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MomsFriendlyDevCo%2Fvite-plugin-inject/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MomsFriendlyDevCo","download_url":"https://codeload.github.com/MomsFriendlyDevCo/vite-plugin-inject/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MomsFriendlyDevCo%2Fvite-plugin-inject/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263108720,"owners_count":23415000,"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-12-05T20:14:23.332Z","updated_at":"2026-02-04T01:04:24.406Z","avatar_url":"https://github.com/MomsFriendlyDevCo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Vite-Plugin-Inject\n==================\nInject files into Vite output.\n\nThis plugin takes a list of file definition and simply writes them into the `/dist` directory (or wherever Vite is configured to output).\n\n\n```javascript\n# vite.config.js\nimport pluginInject from 'vite-plugin-inject';\n\nexport default {\n    plugins: [\n        pluginInject([\n\n            { // An example humans.txt file injected into /dist/humans.txt\n                name: 'humans.txt',\n                content() { return [\n                    '/' + '* TEAM *' + '/',\n                    'Developer: Matt Carter',\n                    'Contact: contact@acme.com',\n                    'Location: Gold Coast, Australia',\n                    '',\n                    '',\n                    '/' + '* SITE *' + '/',\n                    `Last update: ${(new Date()).toISOString().substr(0, 10).replace(/-/g, '\\/')}`,\n                    'Doctype: HTML5',\n                    'Standards: HTML5, CSS3, JavaScript ES2024',\n                    'Components: Vue',\n                ]},\n            },\n\n            {\n                name: 'robots.txt',\n                content() { return [\n                    'User-agent: *',\n                    'Allow: /',\n                    'Disallow: /login',\n                    'Disallow: /profile',\n                    '',\n                    'Sitemap: https://acme.com/sitemap.xml',\n                ]},\n            },\n\n            {\n                name: 'sitemap.xml',\n                async content() {\n                    let {default: routes} = await import('./routes.js');\n\n                    return [\n                        '\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e',\n                        '\u003curlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"\u003e',\n                        ...(tools\n                            .flatMap(route =\u003e [\n                                '\\t\u003curl\u003e',\n                                `\\t\\t\u003cloc\u003ehttps://acme.com${route.path}\u003c/loc\u003e`,\n                                '\\t\\t\u003cchangefreq\u003emonthly\u003c/changefreq\u003e',\n                                '\\t\u003c/url\u003e',\n                            ])\n                        ),\n                        '\u003c/urlset\u003e',\n                    ];\n                },\n            },\n        ]),\n    ],\n}\n```\n\n\nAPI\n===\nThis plugin exposes a single function which takes an array of files to output.\n\nEach file should be an object composed of a `name` string and an Async `content` function which returns the content. The content will be collapsed into a line-delimited string if an array is returned.\n\nFile object definitions:\n\n| Property  | Type       | Default        | Description                                                                      |\n|-----------|------------|----------------|----------------------------------------------------------------------------------|\n| `name`    | `String`   |                | The file name, nested files can be noted with slashes                            |\n| `content` | `Function` |                | A function which can return the string content to output or an array of the same |\n| `mime`    | `String`   | `'text/plain'` | The mime type to serve (when in dev mode)                                        |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmomsfriendlydevco%2Fvite-plugin-inject","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmomsfriendlydevco%2Fvite-plugin-inject","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmomsfriendlydevco%2Fvite-plugin-inject/lists"}