New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vite-plugin-watch

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-plugin-watch

Vite plugin to run custom commands on file changes

  • 0.3.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11K
increased by9%
Maintainers
1
Weekly downloads
 
Created
Source

Vite Watcher Runner

A Vite plugin that runs custom shell commands on file changes.

Installation

You can install the package via npm or yarn:

npm i -D vite-plugin-watch
# or
yarn add -D vite-plugin-watch

Usage

Import the package from vite.config.js and configure it.

import { defineConfig } from "vite"
import { watch } from "vite-plugin-watch"

export default defineConfig({
  plugins: [ 
    watch({
      pattern: "app/{Data,Enums}/**/*.php",
      command: "php artisan typescript:transform",
    }),
  ],
})

Once a tracked file changes, the plugin will execute a specified command.

The paths of tracked files are configured as glob patterns:

  • Use * to match anything except slashes and hidden files
  • Use ** to match zero or more directories
  • Use comma separate values between {} to match against a list of options

Plugin options

nametypedescriptiondefault
patternstring|string[]Tracked files paths
commandstring|string[]One or multiple command(s) to be executed on file change
timeoutnumberTimeout between triggering the same command500
silentbooleanHide the output in the consolefalse
onInitbooleanRun the command on Vite starttrue

Advanced Inertia

Take your Inertia.js skills to the next level with my book Advanced Inertia. Learn advanced concepts and make apps with Laravel and Inertia.js a breeze to build and maintain.

Momentum

Momentum is a set of packages designed to improve your experience building Inertia-powered apps.

  • Modal — Build dynamic modal dialogs for Inertia apps
  • Preflight — Realtime backend-driven validation for Inertia apps
  • Paginator — Headless wrapper around Laravel Pagination
  • Trail — Frontend package to use Laravel routes with Inertia
  • Lock — Frontend package to use Laravel permissions with Inertia
  • Layout — Persistent layouts for Vue 3 apps
  • Vite Plugin Watch — Vite plugin to run shell commands on file changes

Credits

License

The MIT License (MIT). Please see License File for more information.

Keywords

FAQs

Package last updated on 18 Mar 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc