devtools icon indicating copy to clipboard operation
devtools copied to clipboard

Support builds without index.html

Open mrmckeb opened this issue 8 months ago • 2 comments

Clear and concise description of the problem

We have a micro-frontend architecture, and our newest MFE is using Vite 8.

For HMR, we have this in our entry file, which works well. It would be great to have a similar option for the DevTools.

import "@vitejs/plugin-react/preamble";

Suggested solution

Add a preamble for DevTools.

import "@vitejs/devtools/preamble";

Alternative

No response

Additional context

I'm not sure how this would work across multiple MFEs, or if that's on your roadmap.

Validations

  • [x] Follow our Code of Conduct
  • [x] Read the Contributing Guide.
  • [x] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

mrmckeb avatar Mar 25 '26 00:03 mrmckeb

It seems that we currently support it. I have updated it in the document. Try using import '@vitejs/devtools/client/inject' to explicitly import the DevTools client.

webfansplz avatar Mar 25 '26 16:03 webfansplz

Sorry for the slow reply, that does work - thanks!

mrmckeb avatar Apr 08 '26 10:04 mrmckeb