Skip to content
PluginStats

vite-plugin-runtime-env weekly downloads statistics

By micha149 · npm · Vite plugins

Vite plugin which enables you to configure your environment variables when deploying your app.

View on npm Stale · Oct 17, 2026

vite-plugin-runtime-env has 24,963 recorded weekly downloads on npm, a decrease of 39.6% over the past 30 days, ranking #699 of 2,256 tracked listings.

Weekly downloads
24,963
Official API · Oct 17, 2026
7-day growth
-41.4%
-17.6K weekly downloads
30-day growth
-39.6%
-16.3K weekly downloads
90-day growth
+6.0%
+1.4K weekly downloads
Rank
#699
Among tracked npm listings

About vite-plugin-runtime-env

vite-plugin-runtime-env

Inject environment variables on runtime rather than build time.

Installation

Usage

First you need to add the plugin to your vite config.

When building your app, the plugin replaces all occurrences of import.meta.env.VITE_MY_VARIABLE with something like window.env.VITE_MY_VARIABLE and inserts a mapping into index.html. The mapping contains placeholder variables like ${VITE_MY_VARIABLE} which can be substituted using [envsubst][envsubst] or [npx envsub][envsub] when deploying your app.

Or, when Node.js is available in your deployment environment:

Both examples assume that your variables are defined in the deploy environment. The node tool also supports .env files as arguments.

Configuration

variableName

The variable name to be used for replacements. Defaults to 'window.env'.

Example:

injectHtml

Whether to inject the variables map into index.html. Sometimes it can be handy to not have the map in index.html and load an external javascript file which sets the object. Defaults to true.

Example:

substitutionSyntax

The syntax for inserted placeholders. This should match the tool you are using to substitute the variables on deployment. Valid values are 'dollar-basic' for $MYVAR, 'dollar-curly' for ${MYVAR} and 'handlebars' for {{MYVAR}}. Defaults to 'dollar-curly'.

Example:

Now you can use a custom script using handlebars to inject the variables.

ignoreEnv

Variable names to be ignored by this plugin. They will remain in the code and will be statically replaced by Vite on build time. This can be useful for information which is known on build time and not configurable on runtime, such as the version number of the current build. Valid values are an array of strings, containing the variables to be ignored, or a function which gets each variable as an input and returns true if the variable should be skipped.

Example:

Example using a function:

Motivation

If your project wants to adhere to the [12 factor principles][12factor] it can be cumbersome that Vite replaces your environment variables with static content on build time. Following the principle "I – Config" we want to store configurations in the environment. And funnily enough, this is also implied by the name "environment variable". Respecting these principles can be useful when running your app in a containerized setup like Docker or Kubernetes.

A workaround would be to run vite build when deploying the app. But this may slow down our deployments, especially when deploying multiple instances and each one builds the app for its own. Also, this would be contrary to principle "V – Build, release, run" which requires strict separation between the build, release, and run stages.

To be able to create a single bundle and run the same bundle in different environments like testing, staging and production, we need to be able to pass some configurations when the app is deployed. After a lot of projects where each solves this same problem with its own custom workaround, I created this plugin to rule them all.

Description from the npm listing.

  • docker
  • environment
  • 12-factor
  • vite
  • dot-env
  • vite-plugin

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

vite-plugin-runtime-env weekly downloads on npm, last 90 days: 24,963 weekly downloads as of Oct 17, 2026, +6.0% over 90 days.vite-plugin-runtime-envWeekly downloads on npm · Last 90 days24,963downloads / week+6.0% over 90 days20K25K30K35K40K45K50K55K60KJul 19Aug 3Aug 18Sep 2Sep 17Oct 2Oct 17downloads / weekobservedarchived (Internet Archive)no observationsJul 22, 2026 – Oct 17, 2026 · 88 observations · Updated Oc…pluginstats.com
vite-plugin-runtime-env weekly downloads on npm, last 90 days: 24,963 weekly downloads as of Oct 17, 2026, +6.0% over 90 days.

7/30/90-day growth

vite-plugin-runtime-env weekly downloads growth on npm: -41.4% over 7 days, -39.6% over 30 days, +6.0% over 90 days.vite-plugin-runtime-envWeekly downloads growth on npm24,963downloads / week now7-day growth-17,613 weekly downloads-41.4%30-day growth-16,349 weekly downloads-39.6%90-day growth+1,419 weekly downloads+6.0%Growth vs. nearest observation to each baseline date · Updated Oct 17, 2026pluginstats.com
vite-plugin-runtime-env weekly downloads growth on npm: -41.4% over 7 days, -39.6% over 30 days, +6.0% over 90 days.

Ranking history

vite-plugin-runtime-env npm ranking history: currently #699 (by weekly downloads).vite-plugin-runtime-envnpm ranking · by weekly downloads · Last 90 days#699current rank#697#698#699#700#701Jul 21Aug 5Aug 20Sep 4Sep 19Oct 4Oct 19rankOct 18, 2026 – Oct 19, 2026 · 2 observations · Updated Oct 17, 2026pluginstats.com
vite-plugin-runtime-env npm ranking history: currently #699 (by weekly downloads).

Listing placement

All npm2,256 listings · 113 pages · 1,129 shown · page 35, #19 (overall #699)
All npm: every listing in weekly downloads order

Listing placement

Vite plugins250 listings · 13 pages · page 6, #16 (overall #116)
Vite plugins: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (121)
Recent weekly downloads observations for vite-plugin-runtime-env
Date (UTC)Weekly downloadsChange vs. previous
24,963-5.1K
30,092+2.5K
27,579-8.8K
36,393-11.2K
47,6210
47,621+4.7K
42,873+297
42,576+3.8K
38,728+2.3K
36,380-746
37,126-2.6K
39,678-12.4K
52,056-1.5K
53,561—

Similar npm Vite plugins plugins

All 20 vite-plugin-runtime-env alternatives

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/vite-plugin-runtime-env. First seen Oct 16, 2026; last successful collection Oct 19, 2026. See the methodology.