A Vite plugin that captures Vue <Transition> runtime warnings about multiple root nodes and displays actionable fix suggestions via Vite's error overlay during development. Current version 0.2.2, updated occasionally. Key differentiators: focuses exclusively on the common Vue Transition multi-root pitfall, provides localized (zh/en) messages, integrates with Vite's HMR WebSocket for seamless overlay display, and supports both plugin (vite.config) and client (main.ts) setup. Requires Vue >=3.0.0 and Vite >=4.0.0.
npm install vite-check-multiple-domVerified import paths — ran on the pinned version, not inferred.
Demonstrates plugin registration in vite.config.ts and client-side setup in main.ts.
Use only during development; ensure the plugin is not included in production build config.
Place setupVueRootValidator call after all other plugin setups but before mount.
Pass the lang option only to setupVueRootValidator in main.ts.
Use ES module imports. For vite.config.ts, ensure it is an ES module.
If you have your own warnHandler, you may need to combine them manually.
Ensure your TypeScript version supports subpath exports (>=4.7) and that your tsconfig.json includes 'moduleResolution': 'node16' or 'bundler'.
Use default import: import vueRootValidator from 'vite-check-multiple-dom'
Run Vite dev server (not production build). Check browser console for Vue warnings; if they appear, ensure the plugin is correctly set up in both vite.config.ts and main.ts.