{"id":15691541,"url":"https://github.com/zyyv/unplugin-vue-dotenv","last_synced_at":"2025-11-09T19:31:09.793Z","repository":{"id":59506767,"uuid":"527118329","full_name":"zyyv/unplugin-vue-dotenv","owner":"zyyv","description":"Auto generate the corresponding `.env` file.","archived":false,"fork":false,"pushed_at":"2022-09-15T15:54:14.000Z","size":68,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-19T23:32:27.954Z","etag":null,"topics":["plugin","unplugin","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/zyyv.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}},"created_at":"2022-08-21T05:52:24.000Z","updated_at":"2023-07-28T09:39:43.000Z","dependencies_parsed_at":"2022-09-18T08:30:50.982Z","dependency_job_id":null,"html_url":"https://github.com/zyyv/unplugin-vue-dotenv","commit_stats":null,"previous_names":["chris-zhu/unplugin-vue-dotenv"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/zyyv/unplugin-vue-dotenv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zyyv%2Funplugin-vue-dotenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zyyv%2Funplugin-vue-dotenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zyyv%2Funplugin-vue-dotenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zyyv%2Funplugin-vue-dotenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zyyv","download_url":"https://codeload.github.com/zyyv/unplugin-vue-dotenv/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zyyv%2Funplugin-vue-dotenv/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267349769,"owners_count":24073148,"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","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["plugin","unplugin","vite"],"created_at":"2024-10-03T18:22:12.056Z","updated_at":"2025-11-09T19:31:09.532Z","avatar_url":"https://github.com/zyyv.png","language":"TypeScript","readme":"# unplugin-vue-dotenv\n\n[![NPM version](https://img.shields.io/npm/v/unplugin-vue-dotenv?color=a1b858\u0026label=)](https://www.npmjs.com/package/unplugin-vue-dotenv)\n\nAuto generate the corresponding `.env` file.\n\n## Install\n\n```bash\nnpm i unplugin-vue-dotenv\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eVite\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// vite.config.ts\nimport Dotenv from 'unplugin-vue-dotenv/vite'\n\nexport default defineConfig({\n  plugins: [\n    Dotenv({ /* options */ }),\n  ],\n})\n```\n\nExample: [`playground/`](./playground/)\n\n\u003cbr\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eRollup\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// rollup.config.js\nimport Starter from 'unplugin-vue-dotenv/rollup'\n\nexport default {\n  plugins: [\n    Starter({ /* options */ }),\n  ],\n}\n```\n\n\u003cbr\u003e\u003c/details\u003e\n\n\n\u003cdetails\u003e\n\u003csummary\u003eWebpack\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// webpack.config.js\nmodule.exports = {\n  /* ... */\n  plugins: [\n    require('unplugin-vue-dotenv/webpack')({ /* options */ })\n  ]\n}\n```\n\n\u003cbr\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eNuxt\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// nuxt.config.js\nexport default {\n  buildModules: [\n    ['unplugin-vue-dotenv/nuxt', { /* options */ }],\n  ],\n}\n```\n\n\u003e This module works for both Nuxt 2 and [Nuxt Vite](https://github.com/nuxt/vite)\n\n\u003cbr\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eVue CLI\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// vue.config.js\nmodule.exports = {\n  configureWebpack: {\n    plugins: [\n      require('unplugin-vue-dotenv/webpack')({ /* options */ }),\n    ],\n  },\n}\n```\n\n\u003cbr\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eesbuild\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// esbuild.config.js\nimport { build } from 'esbuild'\nimport Starter from 'unplugin-vue-dotenv/esbuild'\n\nbuild({\n  plugins: [Starter()],\n})\n```\n\n\u003cbr\u003e\u003c/details\u003e\n\n## Options\n```ts\nexport interface Options {\n  /**\n   * Generate the corresponding `.env` file according to the mode\n   * @default [['']] // Only generate `.env` file\n   * @example [['test', true]] // Generate `.env.test` and `.env.test.local` files\n   */\n  modes?: modeOpt[]\n  /**\n   * Filepath to generate corresponding .d.ts file.\n   * Default enabled when `typescript` is installed locally.\n   * Set `false` to disable.\n   *\n   * @default './env.d.ts'\n   */\n  dts?: string | boolean\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzyyv%2Funplugin-vue-dotenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzyyv%2Funplugin-vue-dotenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzyyv%2Funplugin-vue-dotenv/lists"}