Socket
Socket
Sign inDemoInstall

vite-plugin-env-compatible

Package Overview
Dependencies
2
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    vite-plugin-env-compatible

Environment Variables Compatible


Version published
Weekly downloads
56K
increased by0.09%
Maintainers
1
Install size
47.0 kB
Created
Weekly downloads
 

Readme

Source

vite-plugin-env-compatible

inject to process.env like vue-cli or create-react-app and also define client process.env.XXX for you.

wakatime NPM Publish downloads npm version License: MIT

Motivation

  • vite expose env to import.meta.env.PREFIX_XXX, but not loaded to process.env like vue-cli or create-react-app.
  • this plugin support setting prefix like VUE_APP_ or REACT_APP_ and loaded to process.env(support by vite@2.5.1).
  • built-in with vue-cli-plugin-vite just for compatibility.

Usage

yarn add vite-plugin-env-compatible
// vite.config.ts
import env from 'vite-plugin-env-compatible'

// @see https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    // ...other plugins
    env(/* options */)
  ],
})

Options

Underlying

  • dotenv & dotenv-expand
  • vite

Further

Keywords

FAQs

Last updated on 01 Dec 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc