Gathering detailed insights and metrics for @originjs/vite-plugin-require-context
Gathering detailed insights and metrics for @originjs/vite-plugin-require-context
Gathering detailed insights and metrics for @originjs/vite-plugin-require-context
Gathering detailed insights and metrics for @originjs/vite-plugin-require-context
npm install @originjs/vite-plugin-require-context
Typescript
Module System
Node Version
NPM Version
plugin-commonjs@1.0.3
Updated on Feb 16, 2022
plugin-load-wasm@1.0.0-beta.2
Updated on Jan 14, 2022
plugin-load-wasm@1.0.0-beta.1
Updated on Jan 14, 2022
plugin-commonjs@1.0.2
Updated on Jan 04, 2022
plugin-require-context@1.0.9
Updated on Nov 10, 2021
plugin-require-context@1.0.8
Updated on Nov 10, 2021
TypeScript (51.6%)
Vue (28.33%)
JavaScript (19.41%)
HTML (0.65%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
NOASSERTION License
174 Stars
104 Commits
29 Forks
4 Watchers
2 Branches
11 Contributors
Updated on Mar 12, 2025
Latest Version
1.0.9
Package Id
@originjs/vite-plugin-require-context@1.0.9
Unpacked Size
38.47 kB
Size
9.23 kB
File Count
6
NPM Version
7.6.3
Node Version
16.2.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
5
Support require.context
in vite
.
snyc
/eager
mode is supported for now./^.*$/
, and it's different from webpack's default regexp /^\.\/.*$/
.require.context.id
is different from webpack.require.context("./dir_name/", true, /\.vue$/)
, require.context("../dir_name/", false, /\.vue$/)
node_modules
: require.context("dir_name", true, /\.vue$/)
src
: require.context("@/dir_name/", true, /\.vue$/)
1npm install @originjs/vite-plugin-require-context --save-dev
or
1yarn add @originjs/vite-plugin-require-context --dev
1import ViteRequireContext from '@originjs/vite-plugin-require-context' 2 3export default { 4 plugins: [ 5 ViteRequireContext( 6 /* options */ 7 ) 8 ] 9}
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 /^.*$/
The following require.context
1const requireComponents = require.context('./components')
will be replaced by
1// generated by @originjs/vite-plugin-require-context 2 3// start of generated code of __require_context_for_vite_function_0, generated by @originjs/vite-plugin-require-context 4import * as __require_context_for_vite_0_0 from "/src/components/a.vue"; 5import * as __require_context_for_vite_0_1 from "/src/components/b.vue"; 6import * as __require_context_for_vite_0_2 from "/src/components/c.vue"; 7 8var __require_context_for_vite_map_0 = { 9 "./a.vue" : __require_context_for_vite_0_0, 10 "./b.vue" : __require_context_for_vite_0_1, 11 "./c.vue" : __require_context_for_vite_0_2 12}; 13function __require_context_for_vite_function_0(req) { 14 var id = __require_context_for_vite_function_0_resolve(req); 15 return __require_context_for_vite_map_0[req]; 16} 17function __require_context_for_vite_function_0_resolve(req) { 18 if (req in __require_context_for_vite_map_0) { 19 return __require_context_for_vite_map_0[req]; 20 } 21 var e = new Error("Cannot find module '" + req + "'"); 22 e.code = 'MODULE_NOT_FOUND'; 23 throw e; 24} 25__require_context_for_vite_function_0.keys = function __require_context_for_vite_function_0_keys() { 26 return Object.keys(__require_context_for_vite_map_0); 27} 28__require_context_for_vite_function_0.resolve = __require_context_for_vite_function_0_resolve 29__require_context_for_vite_function_0.id = "__require_context_for_vite_function_0" 30// end of generated code of __require_context_for_vite_function_0 31 32const requireComponents = __require_context_for_vite_function_0
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
binaries present in source code
Details
Reason
Found 8/24 approved changesets -- score normalized to 3
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More