
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
vite-plugin-env-file
Advanced tools
This Vite plugin allows you to dynamically update your `.env` file during the build process. It's particularly useful for injecting environment variables that depend on the build or development server settings.
This Vite plugin allows you to dynamically update your .env
file during the build process. It's particularly useful for injecting environment variables that depend on the build or development server settings.
To install the plugin, you can use either npm or yarn. Run one of the following commands in your project directory:
npm install vite-plugin-env-file
or yarn add vite-plugin-env-file
Add it to vite.config.js
import viteEnvFile from 'vite-plugin-env-file'
export default {
plugins: [
viteEnvFile({
dev_server_port: 3008,
dev_server_public_url: 'https://www.vite.com',
dev_server_enabled: true
})
],
}
This would render a vite.env
in the project root with something like this:
VITE_DEV_SERVER_PORT="3008"
VITE_DEV_SERVER_PUBLIC_URL="https://www.vite.com"
VITE_DEV_SERVER_ENABLED="true"
When the buildEnd
method is called, these variables and vite.env
file are deleted.
The plugin function takes two arguments: envVars
and options
.
object
or falsy
{ 'custom_var': 'value' }
object
(optional)prefix
: The prefix to be added to all environment variable names.
string
'VITE_'
forceUpperCase
: Whether to convert all environment variable names to uppercase.
boolean
true
envFile
: The name of the environment file to be updated.
string
'vite.env'
FAQs
This Vite plugin allows you to dynamically update your `.env` file during the build process. It's particularly useful for injecting environment variables that depend on the build or development server settings.
The npm package vite-plugin-env-file receives a total of 65 weekly downloads. As such, vite-plugin-env-file popularity was classified as not popular.
We found that vite-plugin-env-file demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.