Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vite-and-run

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-and-run

Start Vite dev server in the current directory and run a custom command whenever a file changes

  • 1.0.2
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

vite-and-run

npx vite-and-run "your_command" starts a Vite server and runs a custom command when files are changed and triggers a hot reload.

What is it?

It's just a wrapper around Vite + vite-plugin-watch-and-run together.
But it's easier to use a single npx command than to install and configure everything.

How to use

Example 1

npx vite-and-run "echo Hello"
  • Starts a Vite server in current directory
  • Runs echo Hello command when any file in current directory is changed.
  • Triggers a hot reload in the browser.

Example 2

npx vite-and-run "tailwindcss -o output.css" "index.html"
  • Starts a Vite server in current directory
  • Runs tailwindcss -o output.css command when index.html is changed.
  • Triggers a hot reload in the browser.

Example 3

npx vite-and-run "node start.js" "src/*.jpg" 1000
  • Starts a Vite server in current directory
  • Runs node start.js command when src/*.jpg files are changed with a 1000 milliseconds delay. Delay is useful when you make changes to multiple files at once and you want to prevent multiple executions of the command.
  • Triggers a hot reload in the browser.

FAQs

Package last updated on 17 Oct 2023

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