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; return mod;
} }
const preLoad = ["index", "package", "browse_folder", "browse_file"]; import index from "./views/index.tsx";
componentCache.set("index", index as Component);
preLoad.forEach((page) => import pkg from "./views/package.tsx";
loadComponent(page).catch((err) => componentCache.set("package", pkg as Component);
console.error("Error preloading", page, err) 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( export default async function render(
name: string, name: string,