Skip to content
PluginStats

@vitejs/plugin-legacy weekly downloads statistics

By vitejs (9 listings) · npm · Vite plugins

Vite's minimum browser support target is [native ESM dynamic import](https://caniuse.com/es6-module-dynamic-import), and [`import.meta`](https://caniuse.com/mdn-javascript_operators_import_meta). This plugin provides support for legacy browsers that do no

View on npm Fresh · Dec 6, 2026

@vitejs/plugin-legacy has 978,834 recorded weekly downloads on npm, a decrease of 2.3% over the past 30 days, ranking #295 of 3,247 tracked listings.

Weekly downloads
978,834
Official API · Dec 5, 2026
7-day growth
+16.0%
+135.4K weekly downloads
30-day growth
-2.3%
-22.8K weekly downloads
90-day growth
+48.2%
+318.3K weekly downloads
Rank
#295
▲ 4 in 7 days

About @vitejs/plugin-legacy

@vitejs/plugin-legacy npm

Vite's minimum browser support target is native ESM dynamic import, and import.meta. This plugin provides support for legacy browsers that do not support those features when building for production.

By default, this plugin will:

  • Generate a corresponding legacy chunk for every chunk in the final bundle, transformed with @babel/preset-env and emitted as SystemJS modules (code splitting is still supported!).

  • Generate a polyfill chunk including SystemJS runtime, and any necessary polyfills determined by specified browser targets and actual usage in the bundle.

  • Inject <script nomodule> tags into generated HTML to conditionally load the polyfills and legacy bundle only in browsers without widely-available features support.

  • Inject the import.meta.env.LEGACY env variable, which will only be true in the legacy production build, and false in all other cases.

Usage

// vite.config.js
import legacy from '@vitejs/plugin-legacy'

export default {
  plugins: [
    legacy({
      targets: ['defaults', 'not IE 11'],
    }),
  ],
}

Terser must be installed for minification when using Vite versions older than 8.1.4 or when build.minify is explicitly set to terser.

npm add -D terser

Options

targets
modernTargets
polyfills
  • Type: boolean | string[]

  • Default: true

    By default, a polyfills chunk is generated based on the target browser ranges and actual usage in the final bundle (detected via @babel/preset-env's useBuiltIns: 'usage').

    Set to a list of strings to explicitly control which polyfills to include. See Polyfill Specifiers for details.

    Set to false to avoid generating polyfills and handle it yourself (will still generate legacy chunks with syntax transformations).

additionalLegacyPolyfills
  • Type: string[]

    Add custom imports to the legacy polyfills chunk. Since the usage-based polyfill detection only covers ES language features, it may be necessary to manually specify additional DOM API polyfills using this option.

additionalModernPolyfills
  • Type: string[]

    Add custom imports to the modern polyfills chunk. Since the usage-based polyfill detection only covers ES language features, it may be necessary to manually specify additional DOM API polyfills using this option.

modernPolyfills
  • Type: boolean | string[]

  • Default: false

    Defaults to false. Enabling this option will generate a separate polyfills chunk for the modern build (targeting browsers that support widely-available features).

    Set to a list of strings to explicitly control which polyfills to include. See Polyfill Specifiers for details.

    If modernTargets is not set, it is not recommended to use the true value (which uses auto-detection) because core-js@3 is very aggressive in polyfill inclusions due to all the bleeding edge features it supports. Even when targeting native ESM support, it injects 15kb of polyfills!

    If you don't have hard reliance on bleeding edge runtime features, it is not that hard to avoid having to use polyfills in the modern build altogether. Alternatively, consider setting modernTargets or using an on-demand service like https://cdnjs.cloudflare.com/polyfill/ to only inject necessary polyfills based on actual browser user-agents (most modern browsers will need nothing!).

renderLegacyChunks
  • Type: boolean

  • Default: true

    Set to false to disable legacy chunks. This is only useful if you are using modernPolyfills, which essentially allows you to use this plugin for injecting polyfills to the modern build only:

    import legacy from '@vitejs/plugin-legacy'
    
    export default {
      plugins: [
        legacy({
          modernPolyfills: [/* ... */],
          renderLegacyChunks: false,
        }),
      ],
    }
    
externalSystemJS…

Description from the npm listing.

  • frontend
  • vite
  • vite-plugin
  • @vitejs/plugin-legacy

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

@vitejs/plugin-legacy weekly downloads on npm, last 90 days: 978,834 weekly downloads as of Dec 5, 2026, +48.2% over 90 days.@vitejs/plugin-legacyWeekly downloads on npm · Last 90 days978,834downloads / week+48.2% over 90 days0200K400K600K800K1M1.2MSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
@vitejs/plugin-legacy weekly downloads on npm, last 90 days: 978,834 weekly downloads as of Dec 5, 2026, +48.2% over 90 days.

7/30/90-day growth

@vitejs/plugin-legacy weekly downloads growth on npm: +16.0% over 7 days, -2.3% over 30 days, +48.2% over 90 days.@vitejs/plugin-legacyWeekly downloads growth on npm978,834downloads / week now7-day growth+135,352 weekly downloads+16.0%30-day growth-22,751 weekly downloads-2.3%90-day growth+318,259 weekly downloads+48.2%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
@vitejs/plugin-legacy weekly downloads growth on npm: +16.0% over 7 days, -2.3% over 30 days, +48.2% over 90 days.

Ranking history

@vitejs/plugin-legacy npm ranking history: currently #295 (by weekly downloads).@vitejs/plugin-legacynpm ranking · by weekly downloads · Last 90 days#295current rank#100#150#200#250#300#350Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 17, 2026 – Dec 6, 2026 · 45 observations · Updated Dec 5, 2026pluginstats.com
@vitejs/plugin-legacy npm ranking history: currently #295 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,083 shown · page 15, #15 (overall #295)
All npm: every listing in weekly downloads order

Listing placement

Vite plugins300 listings · 15 pages · page 2, #18 (overall #38)
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 (592)
Recent weekly downloads observations for @vitejs/plugin-legacy
Date (UTC)Weekly downloadsChange vs. previous
978,834+3.4K
975,479+40.3K
935,221+46.4K
888,803+24.6K
864,250+14.7K
849,542-4.6K
854,177+10.7K
843,482+2.3K
841,167-19K
860,117-26.9K
886,979-8.5K
895,468+7K
888,476-283
888,759—

Similar npm Vite plugins plugins

All 20 @vitejs/plugin-legacy 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/@vitejs/plugin-legacy. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.