auto-hmr

This commit is contained in:
Alexandre
2020-08-01 00:23:02 +02:00
parent f43db2e890
commit 0181578698
2 changed files with 4 additions and 26 deletions
+2 -13
View File
@@ -3,16 +3,5 @@ import { render } from "solid-js/dom";
import "./index.css";
import App from "./App";
const rootEl = document.getElementById("root");
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 = "";
});
}
export const rootEl = document.getElementById("root");
export const dispose = render(() => App, rootEl);
+2 -13
View File
@@ -3,16 +3,5 @@ import { render } from "solid-js/dom";
import "./index.css";
import App from "./App";
const rootEl = document.getElementById("root");
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 = "";
});
}
export const rootEl = document.getElementById("root");
export const dispose = render(() => App, rootEl);