Gathering detailed insights and metrics for vite-plugin-istanbul
Gathering detailed insights and metrics for vite-plugin-istanbul
Gathering detailed insights and metrics for vite-plugin-istanbul
Gathering detailed insights and metrics for vite-plugin-istanbul
vite-plugin-istanbul-widget
集成了 istanbul-widget 和 vite-plugin-istanbul 的vite插件
vite-plugin-istanbul-fix
vite-plugin-istanbul ==========================
swc-plugin-canyon
A SWC plugin cooperates with istanbul to report the coverage
vite-plugin-canyon
To see how to use this plugin, please visit our [documentation](https://docs.canyonjs.org/zh/documentation/ecosystem/vite-plugin-canyon).
A Vite plugin to instrument code for nyc/istanbul code coverage. In similar way as the Webpack Loader istanbul-instrumenter-loader. Only intended for use in development.
npm install vite-plugin-istanbul
Typescript
Module System
Node Version
NPM Version
60.9
Supply Chain
26
Quality
77.2
Maintenance
100
Vulnerability
98.2
License
TypeScript (94.71%)
JavaScript (5.29%)
Total Downloads
29,078,921
Last Day
13,623
Last Week
447,389
Last Month
1,922,415
Last Year
16,783,383
MIT License
102 Stars
545 Commits
21 Forks
2 Watchers
3 Branches
18 Contributors
Updated on Jun 06, 2025
Minified
Minified + Gzipped
Latest Version
7.0.0
Package Id
vite-plugin-istanbul@7.0.0
Unpacked Size
14.26 kB
Size
5.29 kB
File Count
6
NPM Version
10.5.0
Node Version
20.12.2
Published on
Feb 11, 2025
Cumulative downloads
Total Downloads
6
1
A Vite plugin to instrument your code for nyc/istanbul code coverage. In similar way as the Webpack Loader istanbul-instrumenter-loader
. Only intended for use in development while running tests.
Only versions targeting the latest stable Vite version is actively developed.
npm i -D vite-plugin-istanbul
or if you use yarn
yarn add -D vite-plugin-istanbul
1import IstanbulPlugin from 'vite-plugin-istanbul';
Creates the vite plugin from a set of optional plugin options.
Returns: Vite Plugin
opts {IstanbulPluginOptions}
- Object of optional options to pass to the plugin.opts.cwd {string}
- Optional string of the current working directory, used for the include/exclude patterns. Defaults to process.cwd()
.opts.include {string|string[]}
- Optional string or array of strings of glob patterns to include.opts.exclude {string|string[]}
- Optional string or array of strings of glob patterns to exclude.opts.extension {string|string[]}
- Optional string or array of strings of extensions to include (dot prefixed like .js or .ts). By default this is set to ['.js', '.cjs', '.mjs', '.ts', '.tsx', '.jsx', '.vue']
.opts.requireEnv {boolean}
- Optional boolean to require the environment variable (defaults to VITE_COVERAGE) to equal true
in order to instrument the code. Otherwise it will instrument even if env variable is not set. However if requireEnv
is not set the instrumentation will stop if the environment variable is equal to false
.opts.cypress {boolean}
- Optional boolean to change the environment variable to CYPRESS_COVERAGE instead of VITE_COVERAGE. For ease of use with `@cypress/code-coverage``.opts.checkProd {boolean}
- Optional boolean to enforce the plugin to skip instrumentation for production environments. Looks at Vite's isProduction key from the ResolvedConfig
.opts.forceBuildInstrument {boolean}
- Optional boolean to enforce the plugin to add instrumentation in build mode. Defaults to false.opts.nycrcPath {string}
- Path to specific nyc config to use instead of automatically searching for a nycconfig. This parameter is just passed down to @istanbuljs/load-nyc-config
.opts.generatorOpts {GeneratorOptions}
- A set of generator options that are passed down to the Babel transformer. See here for reference. Defaults to empty object.As of v2.1.0 you can toggle the coverage off by setting the env variable VITE_COVERAGE='false'
, by default it will always instrument the code. To require the explicit definition of the variable, set the option requireEnv
to true.
This plugin also requires the Vite configuration build.sourcemap to be set to either true, 'inline', 'hidden'.
But the plugin will automatically default to true if it is missing in order to give accurate code coverage.
The plugin will notify when this happens in order for a developer to fix it. This notification will show even when the plugin is disabled by e.g opts.requireEnv
, VITE_COVERAGE=false
. This is due to a limitation of the API for this kind of feature.
To use this plugin define it using vite.config.js
1// vite.config.js 2import istanbul from 'vite-plugin-istanbul'; 3 4export default { 5 open: true, 6 port: 3000, 7 plugins: [ 8 istanbul({ 9 include: 'src/*', 10 exclude: ['node_modules', 'test/'], 11 extension: ['.js', '.ts', '.vue'], 12 requireEnv: true, 13 }), 14 ], 15};
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 9
Details
Reason
Found 1/3 approved changesets -- score normalized to 3
Reason
2 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 1
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
19 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-23
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 MoreLast Day
-18.8%
13,623
Compared to previous day
Last Week
-7.6%
447,389
Compared to previous week
Last Month
1.8%
1,922,415
Compared to previous month
Last Year
79.9%
16,783,383
Compared to previous year