Skip to content

Getting Started

Prerequisites

Installation

bash
pnpm add -D vite-plugin-knip-ui
bash
npm install -D vite-plugin-knip-ui
bash
yarn add -D vite-plugin-knip-ui

Setup

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()],
})

Usage

  1. Start your Vite dev server
  2. Navigate to /__knip-ui in your browser
  3. Click the play button to run analysis

The UI will display all dead code issues found by Knip, grouped by category.

Next Steps

Released under the MIT License.