New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

vite-plugin-patch-env

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-plugin-patch-env

latest
Source
npmnpm
Version
0.0.5
Version published
Maintainers
1
Created
Source
logo of vite-plugin-patch-env repository

vite-plugin-patch-env

This plugin is used to patch environment variables from the system into Vite

English | 简体中文

Installation

pnpm i -D vite-plugin-patch-env

Usage

// vite.config.ts
import { defineConfig } from "vite";
import PathEnv from "vite-plugin-patch-env";

export default defineConfig({
  plugins: [PathEnv()],
});
> env
...
HOME=/Users/kejun
...
console.log(import.meta.env);
// output
// {
//   //...
//   VITE_HOME: "/Users/kejun"
//   //...
// }

see example

Options

export type EnvName = RegExp | string;

export interface Options {
  names?: EnvName | EnvName[];
}

use names to filter env, default patch all env

Keywords

env

FAQs

Package last updated on 10 Dec 2022

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