aem-vite / vite-aem-plugin

A proxy server and starter kit for using Vite with Adobe Experience Manager.
https://aemvite.dev/guide/front-end/vite-plugin/
Apache License 2.0
10 stars 2 forks source link

fix: react fast refresh by reordering Vite React preamble script first #11

Closed Tyler-Brenneman closed 4 months ago

Tyler-Brenneman commented 4 months ago

Description

Fix React fast refresh script injection

Fixes #10

Additional context

Reorder injection to avoid error

Uncaught Error: @vitejs/plugin-react can't detect preamble. Something is wrong. See https://github.com/vitejs/vite-plugin-react/pull/11#discussion_r430879201

What is the purpose of this pull request?

Before submitting the PR, please make sure you do the following

cshawaus commented 4 months ago

@Tyler-Brenneman Thanks for this fix, surprised it never came up during my test, but good to see it fixed nonetheless.