Socket
Book a DemoInstallSign in
Socket

@dotenv-run/rollup

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dotenv-run/rollup

Run your scripts with dotenv variables

latest
npmnpm
Version
1.3.7
Version published
Maintainers
1
Created
Source

@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, Turbo, etc.) apps/next-app/.env > apps/.env > .env

Install

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

Usage

Create a rollup.config.js configuration file and import the plugin:

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 or the API.

Keywords

dotenv

FAQs

Package last updated on 28 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts