Registry / devops / vite-plugin-inspect

vite-plugin-inspect

JSON →
library11.3.3jsnpmunverified

A Vite plugin for inspecting the intermediate state of Vite plugins, useful for debugging and authoring plugins. Current stable version is v11.3.3, supporting Vite ^6.0.0 || ^7.0.0-0. v12.0.0-beta.1 is available, requiring Vite v8.0.0+ and @vitejs/devtools. Key differentiators: provides a GUI to view transformed module code, plugin hooks, and module dependency graphs during dev and build. ESM-only since v11.0.0. Ships TypeScript types.

npm install vite-plugin-inspect
INSTALL
IMPORT
SIG · VITE-PLUGIN-INSPEC
V
vite-plugin-inspect
devopsjavascriptv11.3.3
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.

Inspect
import Inspect from 'vite-plugin-inspect'
const Inspect = require('vite-plugin-inspect')
Default export; v11.0.0+ is ESM-only, so require() will fail.
default
import Inspect from 'vite-plugin-inspect'
import { Inspect } from 'vite-plugin-inspect'
The package exports a default function, not a named export.
type Options
import type { Options } from 'vite-plugin-inspect'
TypeScript users can import the Options type for configuration.

Sets up vite-plugin-inspect with devtools enabled for debugging plugin transformations in dev mode.

// vite.config.ts import { defineConfig } from 'vite' import Inspect from 'vite-plugin-inspect' export default defineConfig({ devtools: true, plugins: [ Inspect() ], })
Debug
Known issues
breakingv11.0.0 drops CJS support; package is now ESM-only.
fix
Ensure your project uses ESM (type: 'module' in package.json or .mjs file extensions). If using CJS, stay on v10.x.
affects: >=11.0.0
breakingv12.x (beta) migrates to @vitejs/devtools and requires Vite v8.0.0+.
fix
Install @vitejs/devtools as a dependency and add 'devtools: true' to Vite config. Upgrade Vite to v8+.
affects: >=12.0.0-beta.1
deprecatedv11.0.0 deprecated the CJS build; v10.x had incorrect default exports in CJS.
fix
If using CJS with v10.3.0, use `const Inspect = require('vite-plugin-inspect').default` to work around the export issue.
affects: >=10.3.0 <11.0.0
gotchaThe 'build' option must be explicitly set to true to inspect transformations during build mode.
fix
Add `build: true` to the options object: `Inspect({ build: true })`
affects: >=0.0.0
gotchaFor v12.x, the plugin configuration changed: you need to set `devtools: true` or `devtools: { build: { withApp: true } }` in Vite config, not just in the plugin options.
fix
Add the `devtools` key to your Vite config object (not the plugin).
affects: >=12.0.0-beta.1
deprecatedv10.x and earlier used 'vite-plugin-inspect' with CJS; default export was not compatible with CJS require.
fix
Upgrade to v10.3.0+ if you need CJS, or migrate to ESM and use v11.x.
affects: <10.3.0
Errors
Common errors & fixes
Error: Cannot find module 'vite-plugin-inspect'
Package not installed or CJS/ESM mismatch (v11+ is ESM-only).
fix
Run `npm install -D vite-plugin-inspect` and ensure your project is ESM (set `type: 'module'` in package.json).
TypeError: (0 , vite_plugin_inspect_1.default) is not a function
Using named import `{ Inspect }` instead of default import with CJS interop in v10.x.
fix
Use `import Inspect from 'vite-plugin-inspect'` (ESM) or `const Inspect = require('vite-plugin-inspect').default` (CJS, v10.x only).
TypeError: Inspect is not a function
Calling `Inspect()` before the default import resolves; often due to circular dependencies or incorrect import path.
fix
Verify import is `import Inspect from 'vite-plugin-inspect'` and the package is installed correctly.
Error: Cannot find module '@vitejs/devtools'
v12.x requires @vitejs/devtools as a separate dependency.
fix
Run `npm install -D @vitejs/devtools` and add `devtools: true` to Vite config.
Warning: The 'build' option is not enabled. Build transformations will not be captured.
Inspect() called without `build: true` when running `vite build`.
fix
Add `build: true` to the plugin options: `Inspect({ build: true })`.
Upgrade
Version history
11.3.3latest on npm
Audit
Dependencies
viterequiredPeer dependency; the plugin hooks into Vite's plugin system.
@vitejs/devtoolsoptionalRequired for v12.x (beta) to enable devtools integration.
Agent activity
18 hits · last 30 days
node
14
OpenAI (training)
1
Resources
vite-plugin-inspect — npm install vite-plugin-inspect · libregistry