0.0.1 • Published 2 years ago

vite-plugin-hot-client v0.0.1

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

vite-plugin-hot-client

NPM version

Get Vite's import.meta.hot at runtime.

Install

npm i vite-plugin-hot-client

Usage

import { hot } from 'vite-plugin-hot-client'

// import.meta.hot
if (hot) {
  hot.on('update', () => {
    // ...
  })
}
import { createHotContext } from 'vite-plugin-hot-client
'
const hot = createHotContext('/path/to/module')

if (hot) {
  // ...
}

License

MIT License © 2023 Elone Hoo