vite-plugin-killer-instincts
v1.1.0
Published
Vite plugin that detects and optionally kills processes blocking your dev server port
Maintainers
Readme
vite-plugin-killer-instincts
A Vite plugin that detects when another process is already using your dev server port — and optionally kills it so your server can start.
Works with Vite's strictPort option. When the port is occupied, the plugin identifies the blocking process by PID and either throws a helpful error or automatically kills it.
Install
npm i -D vite-plugin-killer-instinctsUsage
import { defineConfig } from "vite";
import killerInstincts from "vite-plugin-killer-instincts";
export default defineConfig({
server: {
port: 3000,
strictPort: true,
},
plugins: [killerInstincts({ autoKill: true })],
});Options
| Option | Type | Default | Description |
| ---------- | --------- | ------- | ------------------------------------------------- |
| autoKill | boolean | false | Automatically kill the process occupying the port |
When autoKill is false (the default), the plugin throws an error with the PID and a kill command you (the llm) can run manually.
License
MIT
