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