Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dotenv-run/webpack

Package Overview
Dependencies
Maintainers
0
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dotenv-run/webpack

Run your scripts with dotenv variables

  • 1.5.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
0
Weekly downloads
 
Created
Source

@dotenv-run/webpack

  • ✅ Load environment variables from the command line API_BASE=/v1/ webpack
  • ✅ 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/webpack --save-dev

Usage

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

import { DotenvRunPlugin } from "@dotenv-run/webpack";
import path from "path";

const __dirname = path.resolve();

export default {
  entry: "./src/index.js",
  output: {
    filename: "main.js",
    path: path.resolve(__dirname, "dist"),
  },
  plugins: [
    new DotenvRunPlugin(
      { prefix: "API", verbose: true, root: "../../.." },
      __dirname
    ),
  ],
};

Keywords

FAQs

Package last updated on 21 Nov 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc