Skip to content

Commit a83a4ab

Browse files
authored
fix: patch react refresh properly (#1444)
While the current patch code works fine as `this` is `undefined` for current Vite, Vite 7+ will pass the context (vitejs/vite#19936) and the current code doesn't work anymore. This PR changes the code to call the hook function with the original `this`. This PR should fix the ecosystem-ci failure. https://github.com/vitejs/vite-ecosystem-ci/actions/runs/15291891294/job/43012757791#step:8:665
1 parent 16f21c7 commit a83a4ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/waku/src/lib/plugins/patch-react-refresh.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const patchReactRefresh = <T extends PluginOption[]>(options: T): T =>
1111
return {
1212
...option,
1313
transformIndexHtml(...args) {
14-
const result = origTransformIndexHtml(...args);
14+
const result = origTransformIndexHtml.call(this, ...args);
1515
if (Array.isArray(result)) {
1616
return result.map((item) => ({
1717
...item,

0 commit comments

Comments
 (0)