
Security News
Potemkin Understanding in LLMs: New Study Reveals Flaws in AI Benchmarks
New research reveals that LLMs often fake understanding, passing benchmarks but failing to apply concepts or stay internally consistent.
vite-plugin-run
Advanced tools
A plugin for running commands when files change or when Vite starts.
npm i -D vite-plugin-run
Install vite-plugin-run
and add it to your Vite configuration:
import { run } from 'vite-plugin-run'
export default defineConfig({
plugins: [
laravel(),
vue(),
run([
{
name: 'typescript transform',
run: ['php', 'artisan', 'typescript:transform'],
pattern: ['app/**/*Data.php', 'app/**/Enums/**/*.php'],
},
{
name: 'build routes',
run: ['php', 'artisan', 'routes:generate'],
condition: (file) => file.includes('/routes/'),
}
]),
],
})
You can either use a pattern
or a condition
to specify how the files changes should be detected.
When a file in your project changes, its path will be given as an argument to condition
. If the function returns true
, a shell command described by run
will be executed.
Option | Type | Description | Default |
---|---|---|---|
silent | bool | Whether to hide the commands output in the console | true |
skipDts | bool | Whether to skip HMR reloads when a .d.ts file changes | true |
input | Runner[] | List of runners | [] |
Optionally, you can directly pass a runner or a list of runner to the plugin options.
Option | Type | Description | Default |
---|---|---|---|
startup | bool | Whether the command should run when Vite starts | true |
build | bool | Whether the command should run when Vite builds | true |
name | string | An identifier for the runner, used in logs | |
condition | () => boolean | A function that should return true for a file change to execute the runner | |
pattern | string or string[] | A minimatch pattern which files must match | |
run | () => string[] or string[] | A command executed when a file changed and the condition matches | |
onFileChanged | () =>void | A callback executed when a file changed and the condition matches | |
delay | number | Delay before the command is executed | 50 |
throttle | number | Delay before the command can be re-executed | 50 |
·
Built with ❤︎ by Enzo Innocenzi
FAQs
Runner plugin for Vite
The npm package vite-plugin-run receives a total of 3,759 weekly downloads. As such, vite-plugin-run popularity was classified as popular.
We found that vite-plugin-run 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
New research reveals that LLMs often fake understanding, passing benchmarks but failing to apply concepts or stay internally consistent.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.