hot

Phot
Bun

Symbol

ImportMeta.hot

hot: { data: any; accept(): void; decline; dispose(cb: (data: any) => void | Promise<void>): void; off(event: HMREvent, callback: () => void): void; on(event: HMREvent, callback: () => void): void }

Hot module replacement APIs. This value is undefined in production and can be used in an if statement to check if HMR APIs are available

if (import.meta.hot) {
  // HMR APIs are available
}

However, this check is usually not needed as Bun will dead-code-eliminate calls to all of the HMR APIs in production builds.

https://bun.sh/docs/bundler/hmr