Registry / devops / vite-build-monitor

vite-build-monitor

JSON →
library1.0.5jsnpmunverified

A Vite plugin (v1.0.5) that monitors heap and RSS memory usage during the build process. It records memory snapshots at configurable intervals, tracks peak usage per build phase, and outputs a summary of the top memory-consuming phases. The plugin supports pretty or JSON log formats, exclusion of specific hooks from logging, and optional uncaught exception capture. It requires Node >=22.0.0 and ships TypeScript declarations. Compared to generic process monitoring, this plugin provides phase-level tracking integrated with Vite's build hooks (buildStart, renderChunk, etc.).

npm install vite-build-monitor
INSTALL
IMPORT
SIG · VITE-BUILD-MONITOR
V
vite-build-monitor
devopsjavascriptv1.0.5
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default (memoryMonitor)
import memoryMonitor from 'vite-build-monitor'
const memoryMonitor = require('vite-build-monitor')
ESM-only; default export. TypeScript types included.
MemoryMonitorOptions
import type { MemoryMonitorOptions } from 'vite-build-monitor'
import { MemoryMonitorOptions } from 'vite-build-monitor'
Type import only; the interface is not a runtime value.
HookName
import type { HookName } from 'vite-build-monitor'
const { HookName } = require('vite-build-monitor')
This is a type union, not a value; requires type import.

Configure vite-build-monitor as a Vite plugin with custom options: log file path, polling interval, log format, and hook exclusions.

// vite.config.ts import { defineConfig } from 'vite'; import memoryMonitor from 'vite-build-monitor'; export default defineConfig({ plugins: [ memoryMonitor({ logFile: './build-memory.log', sampleIntervalMs: 100, logFormat: 'pretty', summaryTopN: 3, excludeHooks: ['buildEnd', 'renderStart'], printSummary: true, }), ], });
Debug
Known issues
breakingThis package requires Node.js >=22.0.0. Older Node versions will fail to install or import.
fix
Upgrade Node.js to v22 or later.
affects: >=1.0.0
gotchaThe sampleIntervalMs option is clamped to minimum 50ms. Setting a value <50 will be silently uplifted to 50.
fix
Explicitly set sampleIntervalMs to at least 50 if you need fine-grained polling.
affects: >=1.0.0
gotchaThe logFile path is resolved relative to process.cwd(), not the project root. This can lead to unexpected file locations.
fix
Always use an absolute path or ensure cwd is the project root when specifying logFile.
affects: >=1.0.0
deprecatedNo deprecated features currently. This is a young package (v1.0.5). Future versions may change defaults or remove options.
fix
Pin to a specific version and review changelog before upgrading.
affects: >=1.0.0
Errors
Common errors & fixes
ERR_REQUIRE_ESM: require() of ES Module 'vite-build-monitor' from ... not supported.
The package is ESM-only, and you are using require() instead of import.
fix
Use import statement: import memoryMonitor from 'vite-build-monitor';
TypeError: Cannot read properties of undefined (reading 'sampleIntervalMs')
Importing the plugin without calling it as a function (e.g., passing memoryMonitor directly instead of memoryMonitor()).
fix
Call the function: plugins: [memoryMonitor({ ... })]
Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'vite-build-monitor'
Package not installed, or installed as devDependency but runtime resolution fails.
fix
Ensure the package is installed: pnpm add -D vite-build-monitor
Upgrade
Version history
1.0.5latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
vite-build-monitor — npm install vite-build-monitor · libregistry