Skip to content
PluginStats

@originjs/vite-plugin-require-context weekly downloads statistics

By originjs (2 listings) · npm · Vite plugins

A vite plugin that support require.context in vite

View on npm Fresh · Dec 5, 2026

@originjs/vite-plugin-require-context has 8,669 recorded weekly downloads on npm, an increase of 10.4% over the past 30 days, ranking #1332 of 3,247 tracked listings.

Weekly downloads
8,669
Official API · Dec 5, 2026
7-day growth
+26.4%
+1.8K weekly downloads
30-day growth
+10.4%
+819 weekly downloads
90-day growth
+28.7%
+1.9K weekly downloads
Rank
#1332
▲ 51 in 7 days

About @originjs/vite-plugin-require-context

vite-plugin-require-context

Support require.context in vite.

Features

  • Based on RegExp search and replacement.
  • Only snyc/eager mode is supported for now.
  • The default regexp is /^.*$/, and it's different from webpack's default regexp /^\.\/.*$/.
  • The implementation of require.context.id is different from webpack.
  • Syntax supported :
    1. search in relative path : require.context("./dir_name/", true, /\.vue$/), require.context("../dir_name/", false, /\.vue$/)
    2. search in node_modules : require.context("dir_name", true, /\.vue$/)
    3. search in src : require.context("@/dir_name/", true, /\.vue$/)

Install

npm install @originjs/vite-plugin-require-context --save-dev

or

yarn add @originjs/vite-plugin-require-context --dev

Usage

import ViteRequireContext from '@originjs/vite-plugin-require-context'

export default {
    plugins: [
        ViteRequireContext(
            /* options */
        )
    ]
}
Options
  • projectBasePath: string The base path of your project used in require.context. Default to be process.cwd()

  • defaultRegExp: RegExp The default RegExp used in require.context if the third parameter regExp of require.context is not specified. Default to be /^.*$/

Implementation details

The following require.context

const requireComponents = require.context('./components')

will be replaced by

// generated by @originjs/vite-plugin-require-context

// start of generated code of __require_context_for_vite_function_0, generated by @originjs/vite-plugin-require-context
import * as __require_context_for_vite_0_0 from "/src/components/a.vue";
import * as __require_context_for_vite_0_1 from "/src/components/b.vue";
import * as __require_context_for_vite_0_2 from "/src/components/c.vue";

var __require_context_for_vite_map_0 = {
	"./a.vue" : __require_context_for_vite_0_0,
	"./b.vue" : __require_context_for_vite_0_1,
	"./c.vue" : __require_context_for_vite_0_2
};
function __require_context_for_vite_function_0(req) {
    var id = __require_context_for_vite_function_0_resolve(req);
    return __require_context_for_vite_map_0[req];
}
function __require_context_for_vite_function_0_resolve(req) {
    if (req in __require_context_for_vite_map_0) {
        return __require_context_for_vite_map_0[req];
    }
    var e = new Error("Cannot find module '" + req + "'");
    e.code = 'MODULE_NOT_FOUND';
    throw e;
}
__require_context_for_vite_function_0.keys = function __require_context_for_vite_function_0_keys() {
    return Object.keys(__require_context_for_vite_map_0);
}
__require_context_for_vite_function_0.resolve = __require_context_for_vite_function_0_resolve
__require_context_for_vite_function_0.id = "__require_context_for_vite_function_0"
// end of generated code of __require_context_for_vite_function_0

const requireComponents = __require_context_for_vite_function_0

Description from the npm listing.

  • vite-plugin
  • require.context

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

@originjs/vite-plugin-require-context weekly downloads on npm, last 90 days: 8,669 weekly downloads as of Dec 5, 2026, +28.7% over 90 days.@originjs/vite-plugin-require-contextWeekly downloads on npm · Last 90 days8,669downloads / week+28.7% over 90 days02K4K6K8K10KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
@originjs/vite-plugin-require-context weekly downloads on npm, last 90 days: 8,669 weekly downloads as of Dec 5, 2026, +28.7% over 90 days.

7/30/90-day growth

@originjs/vite-plugin-require-context weekly downloads growth on npm: +26.4% over 7 days, +10.4% over 30 days, +28.7% over 90 days.@originjs/vite-plugin-require-contextWeekly downloads growth on npm8,669downloads / week now7-day growth+1,810 weekly downloads+26.4%30-day growth+819 weekly downloads+10.4%90-day growth+1,935 weekly downloads+28.7%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
@originjs/vite-plugin-require-context weekly downloads growth on npm: +26.4% over 7 days, +10.4% over 30 days, +28.7% over 90 days.

Ranking history

@originjs/vite-plugin-require-context npm ranking history: currently #1332 (by weekly downloads).@originjs/vite-plugin-require-contextnpm ranking · by weekly downloads · Last 90 days#1332current rank#1100#1150#1200#1250#1300#1350#1400Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 41 observations · Updated Dec 5, 2026pluginstats.com
@originjs/vite-plugin-require-context npm ranking history: currently #1332 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,084 shown · page 67, #12 (overall #1,332)
All npm: every listing in weekly downloads order

Listing placement

Vite plugins300 listings · 15 pages · page 13, #4 (overall #244)
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 (170)
Recent weekly downloads observations for @originjs/vite-plugin-require-context
Date (UTC)Weekly downloadsChange vs. previous
8,669-108
8,777+93
8,684+502
8,182+753
7,429+330
7,099+96
7,003+144
6,859-144
7,003-292
7,295-274
7,569-272
7,841-146
7,987-104
8,091—

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/@originjs/vite-plugin-require-context. First seen Oct 16, 2026; last successful collection Dec 5, 2026. See the methodology.