urban 6e9a6cad7d 直播产品 1 ماه پیش
..
dist 6e9a6cad7d 直播产品 1 ماه پیش
LICENSE 6e9a6cad7d 直播产品 1 ماه پیش
README.md 6e9a6cad7d 直播产品 1 ماه پیش
package.json 6e9a6cad7d 直播产品 1 ماه پیش

README.md

vite-hot-client

NPM version

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

You don't normally need this library directly. It's designed for embedded UI on top of Vite for client-server communication. For example:

Install

npm i vite-hot-client

Usage

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

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

const hot = createHotContext('/path/to/module')

if (hot) {
  // ...
}

Sponsors

License

MIT License © 2022 Anthony Fu