Visualize Knip dead code analysis in Vite DevTools
npm install vite-plugin-knip-ui


Visualize Knip dead code analysis results in your Vite dev server. check out the docs for more information

- Run Knip analysis directly from the browser with one click
- Tree-structured sidebar to view issues grouped by category
- All issue types - files, exports, dependencies, binaries, and more
- Click to open any file in your editor instantly
- Export reports as JSON or CSV
- Real-time status with WebSocket connection indicator
``bash`
pnpm add -D vite-plugin-knip-ui
Add the plugin to your vite.config.ts:
`ts
import { defineConfig } from 'vite'
import knipUi from 'vite-plugin-knip-ui'
export default defineConfig({
plugins: [knipUi()],
})
`
Start your dev server and navigate to /__knip-ui to view the analysis panel.
`ts`
knipUi({
base: '/__knip-ui', // Custom base path for the UI
})
- Vite 5.x, 6.x, or 7.x
- Knip installed in your project
Run Knip in your CI pipeline to prevent dead code from reaching production:
`yaml`
- name: Check for dead code (Knip)
run: pnpm lint:knip
Available scripts:
- pnpm lint:knip - Fails if any dead code is found (strict)pnpm lint:knip:ci
- - Reports issues without failing (gradual)
See the CI/CD Integration Guide for detailed setup instructions.
`bashInstall dependencies
pnpm install
This project is built with:
- Knip - Dead code analysis for TypeScript/JavaScript
- birpc - Extracting RPC utilities by @antfu
- Vite - Next generation frontend tooling
- Vue DevTools UI - UI components
See CONTRIBUTING.md for development guidelines.