{"id":13496295,"url":"https://github.com/IndexXuan/vite-plugin-env-compatible","last_synced_at":"2025-03-28T18:31:51.969Z","repository":{"id":43458292,"uuid":"339958919","full_name":"IndexXuan/vite-plugin-env-compatible","owner":"IndexXuan","description":"Environment Variables Compatible for vite(with vue-cli, create-react-app and so on)","archived":false,"fork":false,"pushed_at":"2024-08-02T15:14:44.000Z","size":101,"stargazers_count":74,"open_issues_count":3,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T11:11:34.639Z","etag":null,"topics":["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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IndexXuan.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":"2021-02-18T06:37:39.000Z","updated_at":"2025-02-14T09:02:30.000Z","dependencies_parsed_at":"2024-01-16T09:54:21.581Z","dependency_job_id":"74a3b953-e134-4b02-8da7-82e7f60b7029","html_url":"https://github.com/IndexXuan/vite-plugin-env-compatible","commit_stats":{"total_commits":28,"total_committers":2,"mean_commits":14.0,"dds":0.1428571428571429,"last_synced_commit":"19b74e42ace68d3fefc2c94fc78a37405473748d"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IndexXuan%2Fvite-plugin-env-compatible","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IndexXuan%2Fvite-plugin-env-compatible/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IndexXuan%2Fvite-plugin-env-compatible/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IndexXuan%2Fvite-plugin-env-compatible/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IndexXuan","download_url":"https://codeload.github.com/IndexXuan/vite-plugin-env-compatible/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246080667,"owners_count":20720568,"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":["vite","vite-plugin"],"created_at":"2024-07-31T19:01:45.320Z","updated_at":"2025-03-28T18:31:50.702Z","avatar_url":"https://github.com/IndexXuan.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# vite-plugin-env-compatible\n\n\u003e inject to process.env like vue-cli or create-react-app and also define client `process.env.XXX` for you.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"wakatime\" src=\"https://wakatime.com/badge/github/IndexXuan/vite-plugin-env-compatible.svg\" /\u003e\n  \u003ca href=\"https://github.com/IndexXuan/vite-plugin-env-compatible/actions/workflows/npm-publish.yml\"\u003e\n   \u003cimg alt=\"NPM Publish\" src=\"https://github.com/IndexXuan/vite-plugin-env-compatible/actions/workflows/npm-publish.yml/badge.svg\" style=\"max-width:100%;\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/vite-plugin-env-compatible\" rel=\"nofollow\"\u003e\n    \u003cimg alt=\"downloads\" src=\"https://img.shields.io/npm/dt/vite-plugin-env-compatible.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/vite-plugin-env-compatible\" rel=\"nofollow\"\u003e\n    \u003cimg alt=\"npm version\" src=\"https://img.shields.io/npm/v/vite-plugin-env-compatible.svg\" style=\"max-width:100%;\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/IndexXuan/vite-plugin-env-compatible/blob/main/LICENSE\"\u003e\n    \u003cimg alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" style=\"max-width:100%;\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## Motivation\n- `vite` expose env to `import.meta.env.PREFIX_XXX`, but not loaded to process.env like vue-cli or create-react-app.\n- ~~this plugin support setting prefix like `VUE_APP_` or `REACT_APP_` and loaded to process.env~~(support by vite@2.5.1).\n- built-in with [vue-cli-plugin-vite](https://github.com/IndexXuan/vue-cli-plugin-vite) just for compatibility.\n\n## Usage\n```sh\nyarn add vite-plugin-env-compatible\n```\n\n```ts\n// vite.config.ts\nimport env from 'vite-plugin-env-compatible'\n\n// @see https://vitejs.dev/config/\nexport default defineConfig({\n  plugins: [\n    // ...other plugins\n    env(/* options */)\n  ],\n})\n```\n\n## Options\n- [@see](https://github.com/IndexXuan/vite-plugin-env-compatible/blob/main/src/lib/options.ts)\n\n## Underlying\n- dotenv \u0026 dotenv-expand\n- [vite](https://github.com/vitejs/vite/blob/27785f7fcc5b45987b5f0bf308137ddbdd9f79ea/packages/vite/src/node/config.ts#L791)\n\n\n## Further\n- [vue-cli-plugin-vite](https://github.com/IndexXuan/vue-cli-plugin-vite)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIndexXuan%2Fvite-plugin-env-compatible","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FIndexXuan%2Fvite-plugin-env-compatible","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIndexXuan%2Fvite-plugin-env-compatible/lists"}