diff --git a/CHANGELOG.md b/CHANGELOG.md index 0461fbe..fa3296e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +Revert the throw when refresh runtime is loaded twice to enable usage in micro frontend apps. This was added to help fix setup usage, and this is not worth an annoying warning for others or a config parameter. + +This revert was done in the Babel plugin last year and I didn't port it back. + ## 3.7.1 Ignore directive sourcemap error [#231](https://github.com/vitejs/vite-plugin-react-swc/issues/231) diff --git a/src/refresh-runtime.js b/src/refresh-runtime.js index 6d34353..7f2e4be 100644 --- a/src/refresh-runtime.js +++ b/src/refresh-runtime.js @@ -547,12 +547,6 @@ function isLikelyComponentType(type) { * Plugin utils */ -if (window.$RefreshReg$) { - throw new Error( - "React refresh runtime was loaded twice. Maybe you forgot the base path?", - ); -} - export function getRefreshReg(filename) { return (type, id) => register(type, filename + " " + id); }