Vite Syntax Hmr API

Use when implementing custom HMR handling, debugging HMR issues, writing HMR-aware modules, or understanding why full reloads happen. Prevents missing the import.meta.hot guard (causing production errors), reassigning hot.data instead of mutating it, and forgetting accept() boundaries. Covers ViteHotContext interface, import.meta.hot guard pattern, hot.accept() for self-accepting and dependency-accepting modules, hot.dispose(), hot.prune(), hot.invalidate(), hot.data for persistent state, hot.on()/hot.off()/hot.send() for custom events, built-in HMR events, and HMR boundary concept. Keywords: vite, HMR, hot module replacement, accept, dispose, invalidate, hot.data, full reload, changes not showing, page reloads instead of HMR, hot reload broken, preserve state on edit.

Impertio-Studio 39f6ac9 4 files · 33.9 KB Updated

File contents

Impertio-Studio/Vite-Claude-Skill-Package/tree/main/skills/source/vite-syntax/vite-syntax-hmr-api commit 39f6ac9591

Frequently asked questions

npx skillmds@latest add impertio-studio/vite-syntax-hmr-api