
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
vite-plugin-command
Advanced tools
A Vite plugin that runs custom shell commands on file changes.
You can install the package via npm:
npm i -D vite-plugin-command
Import the package from vite.config.js and configure it.
import { defineConfig } from "vite"
import { command } from "vite-plugin-command"
export default defineConfig({
plugins: [
command({
pattern: "routes/**/*.php",
run: "php artisan ziggy:generate",
}),
],
})
You can also run multiple commands by passing an array of objects.
export default defineConfig({
plugins: [
command([
{
pattern: "routes/**/*.php",
run: "php artisan ziggy:generate",
},
{
pattern: "app/{Data,Enums}/**/*.php",
run: "php artisan typescript:transform",
},
]),
],
})
Once a tracked file changes, the plugin will execute the specified command.
| name | type | description | default |
|---|---|---|---|
pattern | string or string[] | Tracked files paths (minimatch pattern) | |
run | string | The command to be executed | |
silent | boolean | Hide the command output in the console | false |
throttle | number | Delay before the command can be re-executed (in milliseconds) | 500 |
startup | boolean | Run the command when Vite starts | true |
customOutput | string or (output) => string | Display a custom output in the console after command ran (when set, the command output will be hidden) |
The MIT License (MIT). Please see License File for more information.
FAQs
Vite plugin to run custom commands on file changes
We found that vite-plugin-command demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.