3.0.0 • Published 4 months ago

vite-node-dev v3.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

vite-node-dev

Run Node scripts with vite-node and reload them when they are changed.

Overview

!WARNING
The functionality that vite-node-dev provides is now natively supported by vite-node. As a result, vite-node-dev is no longer being maintained and you should instead use vite-node's --watch option:

vite-node --watch <file>

By default, vite-node has lightning fast support for TypeScript, ESM, Vite plugins, and more! This makes it a great choice for running Node apps. vite-node-dev allows you to run scripts with vite-node while automatically reloading them on change.

Installation

The recommended way to install vite-node-dev is as a dev-dependency of your project with npm (or yarn/pnpm):

npm install --save-dev vite-node-dev

It can also be installed globally:

npm install --global vite-node-dev

Usage

Running a Script

To run a script with vite-node-dev, type vite-node-dev followed by the name of the file. If it is installed locally, prefix the command with npx.

npx vite-node-dev [filename]

You might want to add a script for this command to your project's package.json. To run the following script, type npm run dev.

"scripts": {
  // ...
  "dev": "vite-node-dev index.js" // You can omit the npx prefix inside a script
}

Manually Restarting a Running Script

To manually restart a running script without quitting vite-node-dev, type rs and hit enter.

Running a Script Without Reloading

The --run or -r flag instructs vite-node-dev to run a script with vite-node without reloading it:

npx vite-node-dev --run [filename]

This is effectively equivalent to plain vite-node, but removes the need to manually install another dependency and can easily be passed as an additional argument to npm scripts.

License

MIT license: https://github.com/hugo-t-b/vite-node-dev/blob/main/LICENSE.txt.

3.0.0

4 months ago

1.1.0

2 years ago

2.0.0

1 year ago

1.0.0

2 years ago

0.3.0

2 years ago

0.2.1

2 years ago

0.3.1

2 years ago

0.1.0

2 years ago

0.2.0

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago