aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/index-with-refresh.ts
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2022-01-29 23:48:39 -0800
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2022-01-29 23:48:39 -0800
commit857e9bee0085b13320e3ded423ed8caff30c4e40 (patch)
tree333e1c3e524a46ed908fa921e5af2bb847e46841 /src/runtime/index-with-refresh.ts
parent711e0cef78eb14d92e6789f9c6fe3c434344bfab (diff)
downloadbun-857e9bee0085b13320e3ded423ed8caff30c4e40.tar.gz
bun-857e9bee0085b13320e3ded423ed8caff30c4e40.tar.zst
bun-857e9bee0085b13320e3ded423ed8caff30c4e40.zip
Embed React Fast Refresh in Bun
Fixes https://github.com/Jarred-Sumner/bun/issues/62 If the project has it's own copy of react fast refresh and is bundling, it will use that instead.
Diffstat (limited to 'src/runtime/index-with-refresh.ts')
-rw-r--r--src/runtime/index-with-refresh.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/runtime/index-with-refresh.ts b/src/runtime/index-with-refresh.ts
new file mode 100644
index 000000000..1aceecc67
--- /dev/null
+++ b/src/runtime/index-with-refresh.ts
@@ -0,0 +1,10 @@
+import { __injectFastRefresh } from "./hmr";
+export * from "./hmr";
+export * from "./errors";
+export * from "../runtime.js";
+export { default as regeneratorRuntime } from "./regenerator";
+import * as __FastRefreshRuntime from "../react-refresh";
+if (typeof window !== "undefined") {
+ __injectFastRefresh(__FastRefreshRuntime);
+}
+export { __FastRefreshRuntime };