Improve startup speed
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Fabian Stamm 2021-01-11 15:37:06 +01:00
parent 0202946813
commit 965ca33d33

View File

@ -46,13 +46,14 @@ async function loadComponent(name: string) {
return mod;
}
const preLoad = ["index", "package", "browse_folder", "browse_file"];
preLoad.forEach((page) =>
loadComponent(page).catch((err) =>
console.error("Error preloading", page, err)
)
);
import index from "./views/index.tsx";
componentCache.set("index", index as Component);
import pkg from "./views/package.tsx";
componentCache.set("package", pkg as Component);
import browse_folder from "./views/browse_folder.tsx";
componentCache.set("browse_folder", browse_folder as Component);
import browse_file from "./views/browse_file.tsx";
componentCache.set("browse_file", browse_file as Component);
export default async function render(
name: string,