Skip to content
PluginStats

vite-plugin-entry-shaking weekly downloads statistics

By Dschungelabenteuer (2 listings) · npm · Vite plugins

Mimic tree-shaking behaviour when importing code from an entry file in development mode.

View on npm Fresh · Oct 17, 2026

vite-plugin-entry-shaking has 2,237 recorded weekly downloads on npm, a decrease of 70.0% over the past 30 days.

It ranks #1261 of 2,256 tracked npm listings by weekly downloads.

Over 90 days, weekly downloads changed by -85.6%.

PluginStats has 121 daily observations since Jun 19, 2026; the latest is from Oct 17, 2026.

Weekly downloads
2,237
Official API · Oct 17, 2026
7-day growth
-62.2%
-3.7K weekly downloads
30-day growth
-70.0%
-5.2K weekly downloads
90-day growth
-85.6%
-13.3K weekly downloads
Rank
#1261
Among tracked npm listings

About vite-plugin-entry-shaking

vite-plugin-entry-shaking

Mimic tree-shaking behaviour when importing code from an entry file in development mode.

[!NOTE] The main execution logic of this plugin only applies to development mode because it addresses an issue which is specific to development mode. It _may_ be used in test environments that rely on Vite (e.g. Vitest) but should be used with caution as stated in limitations.

Install

Usage

Setup the plugin in your Vite configuration file.

Plugin options

Option name Type Default Description

targets (required) • string[] • { path: string }[] • { glob: string; globOptions: import('fast-glob').Options }[]

N/A You need to list all of the entry points you want this plugin to process.

extensions string[] ['js', 'jsx', 'mjs', 'ts', 'tsx', 'mts'] This specifies which file extensions you want this plugin to process.

ignorePatterns (string | RegExp)[] [/node_modules/] This specifies RegExp/string whose matched paths must be ignored by the plugin.

maxWildcardDepth number 0 How deep should this plugin run static analysis when encountering wildcards?

diagnostics boolean | DiagnosticsConfig true Toggles all diagnostics when set as a boolean, or specific diagnostics when set as an object.

debug boolean false Toggles debug mode. This will print debug logs if Vite's logLevel is set to any other value than 'silent'

Diagnostics configuration

Diagnostics are recommendations/warnings emitted by the plugin as it analyzes the specified entry files. They aim to help you improve the plugin's efficiency by suggesting changes and provide explanation on why they were emitted. See RESOURCES for a more in-depth insight about possible diagnostics.

Name Default Description

definedWithinEntry true Emit warning if an entry file defines code that may prevent tree-shaking.

maxDepthReached true Emits a warning when max analysis depth was reached when handling wildcard imports.

Examples

Examples illustrating usage and benefits can be found here. Feel free to fork and play around. For instance, you can toggle the plugin on and off their respective vite config file while serving in development mode and see how it affects the amount of requests made by your browser.

This repository provides a simple CLI to help you quickly scaffold a new example, simply run the following command from the project's root to get started:

Debugger (experimental)

Version 0.4.0 introduces a debugger as an optional dependency. When installed and attached to the plugin, a debugger application will open alongside your actual application in dev mode. This can help you get an overall idea of what the plugin is processing and its impacts on performances.

[!NOTE] This requires installing vite-plugin-entry-shaking-debugger and setting the debug option to true.

Motivation

The problem this plugin tries to address is well described by this Vite's github issue, so we'll stick to its author's example. Suppose your codebase contains an index file which is basically used as an entry point to dispatch code imported from other files. This is a rather common pattern which may be handy and avoid writing a lot of individual import statements:

Let's pretend you have a module which imports c from that entry point:

In development mode, when Vite serves the module.ts file, the browser loads the shared/index.ts file which initiates requests for all of the three a, b and c modules it relies on. The thing is, we actually only needed the c module, this results in both a and b requests being unnecessary!

As your projet and entry points grow, you end up paying the price for the ever-increasing amount of unnecessary requests and HMR updates, which consumes time and resources. Well, that escalated quickly. Let's try to work around this…

The idea

The main idea is to rewrite imports from a target entry point and replace them by individual imports of the actual module. Back with the above example:

This way, the shared/index.ts file is not loaded by the browser anymore and no additional requests are initiated.

How it works

First of all, the plugin reads all of the target entry files listed in the plugin's targets option. For each entry file :

• It uses es-module-lexer to get a list of imports and exports. • It stores named exports that are re-exports of code imported from another module and the path they resolve to. It also stores whether this re-exported code is the default or a named export of its origin. This lets us correctly rewrite the import using the adequate statement. • It also tracks a mutated version of the entry file where these stored named exports are removed. This is required because we might still import code which is actually defined within the entry file, rather than exported from another module. To make these work, we'll still need to serve this mutated version of the entry file so that this kind of code can be reached.

Whenever Vite serves a file which includes an import which resolved to one of the targets, this file is transformed to rewrite the relevant import statements. It extracts the list of entities imported from that entry file, and for each imported entity :

• it removes the import statement of that entry file. • if it has a matching stored named export, it adds a direct import to the relevant module's absolute path, taking into consideration whether it imports a named export or a default export. • If it has no matching stored named export, it is some code which is actually defined within the entry file. These are batched and eventually add a recomposed import of the target.

When encountering the above latest case, we have the browser still loading the shared/index.ts, which could therefore trigger unnecessary requests, as described earlier. To prevent this kind of scenario, any import of an entry point is caught and is forced to serve its mutated version we stored while parsing the entry point file. This ensures the entry point only imports what it needs to make the code it explicitly defines work.…

Description from the npm listing.

  • vite
  • vite-plugin
  • entry
  • tree shaking

Charts

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

Adoption over time

vite-plugin-entry-shaking weekly downloads on npm, last 90 days: 2,237 weekly downloads as of Oct 17, 2026, -85.6% over 90 days.vite-plugin-entry-shakingWeekly downloads on npm · Last 90 days2,237downloads / week-85.6% over 90 days02K4K6K8K10K12K14K16K18KJul 19Aug 3Aug 18Sep 2Sep 17Oct 2Oct 17downloads / weekobservedarchived (Internet Archive)no observationsJul 21, 2026 – Oct 17, 2026 · 89 observations · Updated Oc…pluginstats.com
vite-plugin-entry-shaking weekly downloads on npm, last 90 days: 2,237 weekly downloads as of Oct 17, 2026, -85.6% over 90 days.
PNG SVG

7/30/90-day growth

vite-plugin-entry-shaking weekly downloads growth on npm: -62.2% over 7 days, -70.0% over 30 days, -85.6% over 90 days.vite-plugin-entry-shakingWeekly downloads growth on npm2,237downloads / week now7-day growth-3,676 weekly downloads-62.2%30-day growth-5,213 weekly downloads-70.0%90-day growth-13,292 weekly downloads-85.6%Growth vs. nearest observation to each baseline date · Updated Oct 17, 2026pluginstats.com
vite-plugin-entry-shaking weekly downloads growth on npm: -62.2% over 7 days, -70.0% over 30 days, -85.6% over 90 days.
PNG SVG

Ranking history

vite-plugin-entry-shaking npm ranking history: currently #1261 (by weekly downloads).vite-plugin-entry-shakingnpm ranking · by weekly downloads · Last 90 days#1261current rank#1257#1258#1259#1260#1261#1262#1263Jul 21Aug 5Aug 20Sep 4Sep 19Oct 4Oct 19rankOct 18, 2026 – Oct 19, 2026 · 2 observations · Updated Oct 17, 2026pluginstats.com
vite-plugin-entry-shaking npm ranking history: currently #1261 (by weekly downloads).
PNG SVG

Listing placement

All npm2,256 listings · 113 pages · 1,130 shown · page 64, #2 (overall #1,262)
All npm: every listing in weekly downloads order
PNG SVG

Listing placement

Vite plugins250 listings · 13 pages · page 13, #2 (overall #242)
Vite plugins: every listing in weekly downloads order
PNG SVG

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 log 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-entry-shaking
Date (UTC)Weekly downloadsChange vs. previous
2,237-172
2,409-568
2,977-1.6K
4,613-1.5K
6,0680
6,068+180
5,888-25
5,913-67
5,980+649
5,331+485
4,846+284
4,562-1.8K
6,371-587
6,958—

Similar npm Vite plugins plugins

All 20 vite-plugin-entry-shaking 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-entry-shaking. First seen Oct 16, 2026; last successful collection Oct 19, 2026. See the methodology.