implemented esbuild and cleaned up stuff

cobalt should now load even faster
This commit is contained in:
wukko
2022-07-30 15:01:54 +06:00
parent f6b0894def
commit 22c16b2fc8
36 changed files with 31 additions and 70 deletions

14
src/modules/build.js Normal file
View File

@@ -0,0 +1,14 @@
import * as esbuild from "esbuild";
export async function buildFront() {
try {
await esbuild.build({
entryPoints: ['src/front/cobalt.js', 'src/front/cobalt.css'],
outdir: `min/`,
minify: true,
loader: {".js": "js", ".css": "css"}
})
} catch (e) {
return;
}
}

View File

@@ -46,9 +46,9 @@ export default function(obj) {
<link rel="icon" type="image/png" sizes="16x16" href="icons/favicon-16x16.png" />
<link rel="apple-touch-icon" sizes="180x180" href="icons/apple-touch-icon.png" />
<link rel="manifest" href="cobalt.webmanifest" />
<link rel="manifest" href="manifest.webmanifest" />
<link rel="stylesheet" href="cobalt.css" />
<link rel="stylesheet" href="fonts/notosansmono/notosansmono.css" />
<link rel="stylesheet" href="fonts/notosansmono.css" />
<noscript><div style="margin: 2rem;">${loc(obj.lang, 'NoScriptMessage')}</div></noscript>
</head>