Skip to content

Commit 6b4759f

Browse files
authored
fix: compatibility with react-refresh runtime in @vitejs/plugin-react (#20)
1 parent 7188d89 commit 6b4759f

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- fix: commonjs default export (fixes [#14](https://github.com/vitejs/vite-plugin-react-swc/issues/14))
66
- fix: support Vite base option (fixes [#18](https://github.com/vitejs/vite-plugin-react-swc/issues/18))
7+
- fix: compatibility with react-refresh runtime in @vitejs/plugin-react ([#20](https://github.com/vitejs/vite-plugin-react-swc/pull/20))
78

89
## 3.0.0
910

src/refresh-runtime.js

+8
Original file line numberDiff line numberDiff line change
@@ -630,3 +630,11 @@ function predicateOnExport(moduleExports, predicate) {
630630
}
631631
return true;
632632
}
633+
634+
// For backwards compatibility with @vitejs/plugin-react.
635+
export default {
636+
getRefreshReg,
637+
injectIntoGlobalHook,
638+
createSignatureFunctionForTransform,
639+
validateRefreshBoundaryAndEnqueueUpdate,
640+
};

0 commit comments

Comments
 (0)