✨ auto-hmr
This commit is contained in:
+2
-13
@@ -3,16 +3,5 @@ import { render } from "solid-js/dom";
|
|||||||
import "./index.css";
|
import "./index.css";
|
||||||
import App from "./App";
|
import App from "./App";
|
||||||
|
|
||||||
const rootEl = document.getElementById("root");
|
export const rootEl = document.getElementById("root");
|
||||||
const dispose = render(() => App, rootEl);
|
export const dispose = render(() => App, rootEl);
|
||||||
|
|
||||||
// HMR stuff, this will be automatically removed during build
|
|
||||||
// /!\ You need to add "vite" in the "compilerOptions.types" of your tsconfig.json
|
|
||||||
// if you want to avoid type errors here
|
|
||||||
if (import.meta.hot) {
|
|
||||||
import.meta.hot.accept();
|
|
||||||
import.meta.hot.dispose(() => {
|
|
||||||
dispose();
|
|
||||||
rootEl.textContent = "";
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|||||||
+2
-13
@@ -3,16 +3,5 @@ import { render } from "solid-js/dom";
|
|||||||
import "./index.css";
|
import "./index.css";
|
||||||
import App from "./App";
|
import App from "./App";
|
||||||
|
|
||||||
const rootEl = document.getElementById("root");
|
export const rootEl = document.getElementById("root");
|
||||||
const dispose = render(() => App, rootEl);
|
export const dispose = render(() => App, rootEl);
|
||||||
|
|
||||||
// HMR stuff, this will be automatically removed during build
|
|
||||||
// /!\ You need to add "vite" in the "compilerOptions.types" of your tsconfig.json
|
|
||||||
// if you want to avoid type errors here
|
|
||||||
if (import.meta.hot) {
|
|
||||||
import.meta.hot.accept();
|
|
||||||
import.meta.hot.dispose(() => {
|
|
||||||
dispose();
|
|
||||||
rootEl.textContent = "";
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user