add solid-devtools
Some checks failed
/ depoly (push) Failing after 1m14s

This commit is contained in:
thislight 2024-11-13 19:27:35 +08:00
parent 4d9c2b3aa8
commit c97f61db06
No known key found for this signature in database
GPG key ID: FCFE5192241CCD4E
6 changed files with 30 additions and 1 deletions

View file

@ -1,4 +1,10 @@
import { render } from "solid-js/web";
import App from "./App.js";
import "solid-devtools";
render(() => <App />, document.getElementById("root")!);
if (import.meta.env.VITE_DEVTOOLS_OVERLAY === "true") {
const overlay = await import("@solid-devtools/overlay")
overlay.attachDevtoolsOverlay()
}

4
src/overrides.d.ts vendored
View file

@ -7,6 +7,10 @@ interface ImportMetaEnv {
* The code reversion. It's recommended to be the git commit sha.
*/
readonly VITE_CODE_VERSION?: string;
/**
* Attach the overlay (in the dev mode) if it's `"true"`.
*/
readonly VITE_DEVTOOLS_OVERLAY?: string;
}
interface ImportMeta {