Version
  • 1.0.0 This plugin will restart the server when a file is changed. This is useful for files that are not imported by the app. For example, if you have a file that is used by a serverless function.

Examples

// vite.config.js
import { restarter } from '@neuekit/utils'

export default {
  plugins: [
    restarter('src/functions/my-function.js')
  ]
}
// vite.config.js
import { restarter } from '@neuekit/utils'

export default {
  plugins: [
    restarter(['.ts', '.js'])
  ]
}
 *
// vite.config.js
import { restarter } from '@neuekit/utils'
// the second argument is a boolean that determines if the server should be fully reloaded or just restarted
export default {
  plugins: [
    restarter(['.ts', '.js'], true)
  ]
}