0.1.2 • Published 2 years ago

vite-plugin-watch-and-restart v0.1.2

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Prop

PropTypeRequiredDefaultDescription
pathstring-The file or folder path to watch
isForcebooleanfalseIgnoring previously cached optimized dependencies
delayboolean500Restart after 500ms

Usage

Install

npm i vite-plugin-watch-and-restart -D # yarn add vite-plugin-watch-and-restart -D

Add it to vite.config.js

// vite.config.js
import ViteWatchRestart from 'vite-plugin-watch-and-restart'

export default {
  plugins: [
    ViteWatchRestart({
      path: 'src/index.ts',
      isForce: false,
      delay: 500,
    })
  ],
}

Changes to src/index.ts will restart the server automatically after 500ms.

You can set the isForce to true to force dependency pre-bundling, ignoring previously cached optimized dependencies.

This may be useful if you use yalc to debug local packages in your Vite project.

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago