Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update plugin-react-refresh README.md for middleware mode #1856

Merged
merged 2 commits into from
Feb 3, 2021
Merged

docs: update plugin-react-refresh README.md for middleware mode #1856

merged 2 commits into from
Feb 3, 2021

Conversation

pengx17
Copy link
Contributor

@pengx17 pengx17 commented Feb 3, 2021

While I was setting up a react app with Vite, everything works fine before enabling reactRefresh plugin.
When this is enabled, we will get a "vite-plugin-react can't detect preamble" error. After some investigation, looks like on the userland we need to explicitly transform the index file with ViteDevServer.transformIndexHtml.

Related:

pengx17 and others added 2 commits February 3, 2021 15:43
While I was setting up a react app with Vite, everything works fine except `reactRefresh`. When this is enabled, we will get a "vite-plugin-react can't detect preamble" error. After some investigation, looks like we need to explicitly transform the index file with `ViteDevServer.transformIndexHtml`.

Related https://github.com/vitejs/vite/blob/da365475b157576427a92f8cfecaacf36e20b97e/packages/vite/src/node/server/index.ts#L449
@yyx990803 yyx990803 merged commit 501bef2 into vitejs:main Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants