# @dotenv-run/rollup

> Run your scripts with dotenv variables

Latest version **1.3.8** (published 2026-08-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install @dotenv-run/rollup
pnpm add @dotenv-run/rollup
yarn add @dotenv-run/rollup
bun add @dotenv-run/rollup
```

## Health

**Score 60/100 (C)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.3.8 |
| Published | 2026-08-13 |
| First published | 2023-07-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 2.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Chihab Otmani |
| Maintainers | chihab |
| Keywords | dotenv, run, cli |

## Links

- npm: https://www.npmjs.com/package/@dotenv-run/rollup
- Homepage: https://github.com/chihab/dotenv-run
- npm.io page: https://npm.io/package/@dotenv-run/rollup

## Dependencies (2)

- [@dotenv-run/core](https://npm.io/package/@dotenv-run/core.md) ^1.3.7
- [@rollup/plugin-replace](https://npm.io/package/@rollup/plugin-replace.md) ^5.0.7

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 1.3.8 (latest) — 2026-08-13
- 1.3.7 — 2025-06-28
- 1.3.6 — 2024-10-13
- 1.3.4 — 2024-01-13
- 1.3.3 — 2024-01-11
- 1.3.2 — 2024-01-10
- 1.3.1 — 2024-01-10
- 1.3.0 — 2024-01-07
- 1.2.3 — 2023-11-22
- 1.2.2 — 2023-11-16
- 1.2.1 — 2023-11-13
- 1.2.0 — 2023-10-25
- 1.1.1 — 2023-08-27
- 1.1.0 — 2023-08-27
- 1.0.1 — 2023-07-30
- … 2 more at https://npm.io/package/@dotenv-run/rollup/versions

## README

# @dotenv-run/rollup

- ✅ Load environment variables from the command line `API_BASE=/v1/ rollup`
- ✅ Load environment variables from `.env` files
- ✅ Expand environment variables `API_URL=$API_BASE/users`
- ✅ Define environment variables for a specific environment (e.g. `.env.production`)
- ✅ Load priorities of `.env.*` files (e.g. `.env.production` > `.env`)
- ✅ Hierarchical cascading configuration in monorepo projects ([Nx](https://nx.dev), [Turbo](https://turborepo.com/), etc.)
  `apps/next-app/.env` > `apps/.env` > `.env`

## Install

```sh
npm add @dotenv-run/rollup --save-dev
```

## Usage

Create a `rollup.config.js` [configuration file](https://www.rollupjs.org/guide/en/#configuration-files) and import the plugin:

```js
import env from "@dotenv-run/rollup";

export default {
  input: "src/index.js",
  output: {
    file: "dist/index.js",
  },
  plugins: [env({ prefix: "API", verbose: true, root: "../../.." })],
};
```

Then call `rollup` either via the [CLI](https://www.rollupjs.org/guide/en/#command-line-reference) or the [API](https://www.rollupjs.org/guide/en/#javascript-api).

---
_Source: https://npm.io/package/@dotenv-run/rollup · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
