
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
vite-plugin-performance
Advanced tools
vite-plugin-performance wraps one or more Vite plugins and measures how long each lifecycle hook takes. It keeps the original behaviour intact while giving you actionable performance insights.
hooks: 'all' to cover every function hookpnpm add -D vite-plugin-performance
# or npm / yarn / bun
import { defineConfig } from 'vite'
import Inspect from 'vite-plugin-inspect'
import { wrapPlugin } from 'vite-plugin-performance'
export default defineConfig({
plugins: [
wrapPlugin(Inspect(), {
threshold: 50,
onHookExecution({ pluginName, hookName, duration }) {
reportToAPM({ pluginName, hookName, duration })
},
}),
],
})
Whenever a hook crosses the threshold (default 0 ms) you will see output similar to:
[inspect] transform ⏱ 78.42 ms
| Option | Type | Default | Description |
|---|---|---|---|
hooks | PluginHookName[] | 'all' | DEFAULT_PLUGIN_HOOKS | Choose which hooks to wrap; pass 'all' to wrap every function hook |
threshold | number | 0 | Only hooks with a duration greater or equal to the threshold are reported |
silent | boolean | false | Disable the built-in logger |
logger | (message, context) => void | console.log | Custom log writer |
formatter | (context) => string | [plugin] transform ⏱ 12.34 ms | Custom message formatter |
onHookExecution | (context) => void | undefined | Callback invoked after a hook finishes |
clock | () => number | performance.now or Date.now | High-resolution timer, handy for tests |
The legacy misspelled option
slientis still recognised and mapped tosilent.
import { DEFAULT_PLUGIN_HOOKS } from 'vite-plugin-performance'
// [
// 'options',
// 'config',
// 'configResolved',
// 'configureServer',
// 'buildStart',
// 'resolveId',
// 'load',
// 'transform',
// 'buildEnd',
// 'generateBundle',
// 'renderChunk',
// 'writeBundle',
// ]
const pluginA = ...
const pluginB = ...
export default defineConfig({
plugins: wrapPlugin([pluginA, pluginB], { threshold: 20 }),
})
wrapPlugin(plugin, {
formatter({ pluginName, hookName, duration }) {
return `${pluginName}:${hookName} took ${duration}ms`
},
logger(message) {
myLogger.info(message)
},
})
wrapPlugin(plugin, {
hooks: ['resolveId', 'load', 'transform'],
})
pnpm --filter vite-plugin-performance test
MIT
FAQs
vite-plugin-performance
The npm package vite-plugin-performance receives a total of 311 weekly downloads. As such, vite-plugin-performance popularity was classified as not popular.
We found that vite-plugin-performance demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.