{"id":15651540,"url":"https://github.com/andarist/rollup-plugin-dotenv","last_synced_at":"2025-07-22T08:05:07.370Z","repository":{"id":51312197,"uuid":"137999235","full_name":"Andarist/rollup-plugin-dotenv","owner":"Andarist","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-15T08:40:54.000Z","size":18,"stargazers_count":33,"open_issues_count":2,"forks_count":12,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-24T07:39:32.355Z","etag":null,"topics":["dotenv","rollup","rollup-plugin"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/Andarist.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-20T07:57:41.000Z","updated_at":"2024-06-11T19:23:56.000Z","dependencies_parsed_at":"2024-04-15T10:03:50.564Z","dependency_job_id":null,"html_url":"https://github.com/Andarist/rollup-plugin-dotenv","commit_stats":{"total_commits":23,"total_committers":5,"mean_commits":4.6,"dds":"0.17391304347826086","last_synced_commit":"e25acabcacf4dd5313cc06797845b22eef286eec"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/Andarist/rollup-plugin-dotenv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Andarist%2Frollup-plugin-dotenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Andarist%2Frollup-plugin-dotenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Andarist%2Frollup-plugin-dotenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Andarist%2Frollup-plugin-dotenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Andarist","download_url":"https://codeload.github.com/Andarist/rollup-plugin-dotenv/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Andarist%2Frollup-plugin-dotenv/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266455037,"owners_count":23931349,"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-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["dotenv","rollup","rollup-plugin"],"created_at":"2024-10-03T12:38:56.170Z","updated_at":"2025-07-22T08:05:07.348Z","avatar_url":"https://github.com/Andarist.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rollup-plugin-dotenv\n\n## Installation\n\n```console\nnpm install rollup-plugin-dotenv\n```\n\n## Usage\n\nCreate a `rollup.config.js` [configuration file](https://www.rollupjs.org/guide/en/#configuration-files) and import the plugin:\n\n```js\nimport dotenv from \"rollup-plugin-dotenv\"\n\nexport default {\n  input: \"src/index.js\",\n  output: [\n    dir: \"dist/build\"\n  ],\n  plugins: [\n    dotenv()\n  ]\n}\n```\n\ncreate your `.env` file in the root of your project.\n\n```bash\n# .env\nFOO=bar\n```\n\nso you can use FOO in your javascript files.\n\n```js\n// src/index.js\nconsole.log(process.env.FOO)\n```\n\nyour env variables will be replaced by their values in your bundled file.\n\n```js\n// dist/build/index.js\nconsole.log('bar')\n```\n\nif you want to know more about the principle and restrictions of replacement, please read [@rollup/plugin-replace](https://www.npmjs.com/package/@rollup/plugin-replace) notes.\n\n## Options\n\nYou can specify the options below.\n\n### `cwd`\n\nType: `String`\nDefault: `\".\"`\n\ndirectory in which to search for env files.\n\n### `envKey`\n\nType: `String`\nDefault: `\"NODE_ENV\"`\n\nkey used to search for .env files by node environment\n\nRollup will merge env vars located at\n\n```\n[\n  `.env.${process.env[envKey]}.local`,\n  `.env.${process.env[envKey]}`,\n  '.env.local',\n  '.env',\n]\n```\n\nso if you are in `prod`, rollup will search in\n\n```\n['.env.prod.local', '.env.prod', '.env.local', '.env']\n```\n\nand merge the result.\n\n[LICENSE (MIT)](/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandarist%2Frollup-plugin-dotenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandarist%2Frollup-plugin-dotenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandarist%2Frollup-plugin-dotenv/lists"}