FreeDATA/gui/index.html
2023-10-22 22:23:23 +00:00

40 lines
1.1 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta
http-equiv="Content-Security-Policy"
content="script-src 'self' 'unsafe-inline';"
/>
<title>FreeDATA</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
<script type="module">
// debugging code for figuring out correct folder structure in build environment
console.log(process.env);
import { readdir } from "node:fs/promises";
import { readdirSync } from "fs";
import { join } from "path";
function walk(dir) {
return readdirSync(dir, { withFileTypes: true }).flatMap((file) =>
file.isDirectory() ? walk(join(dir, file.name)) : join(dir, file.name),
);
}
if (process.env["NODE_ENV"] == "production") {
console.log(walk(process.env["APPDIR"]));
console.log(walk(process.env["DIST"]));
console.log(walk(process.env["DIST_ELECTRON"]));
} else {
console.log("running in " + process.env["NODE_ENV"]);
}
</script>