Overview of Vite Client-Side HMR API
import.meta.hot object. This API is primarily intended for framework and tool developers. To ensure that HMR code is removed from production builds, all calls to the HMR API must be wrapped in a conditional check for import.meta.hot.if (import.meta.hot) {
// HMR code
}