0.3.1 • Published 2 months ago

vite-plugin-watch v0.3.1

Weekly downloads
-
License
-
Repository
github
Last release
2 months ago

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.

0.3.1

2 months ago

0.3.0

2 months ago

0.2.0

11 months ago

0.1.1

1 year ago

0.1.0

1 year ago