FreeDATA/gui/index.html

41 lines
1.1 KiB
HTML
Raw Permalink Normal View History

2023-10-22 22:23:23 +00:00
<!doctype html>
2023-09-02 11:37:03 +00:00
<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" />
2023-10-22 22:23:23 +00:00
<meta
http-equiv="Content-Security-Policy"
content="script-src 'self' 'unsafe-inline';"
/>
2023-09-05 19:06:48 +00:00
<title>FreeDATA</title>
2023-09-02 11:37:03 +00:00
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
<script type="module">
2023-10-22 22:23:23 +00:00
// debugging code for figuring out correct folder structure in build environment
console.log(process.env);
2023-10-22 22:23:23 +00:00
import { readdir } from "node:fs/promises";
import { readdirSync } from "fs";
import { join } from "path";
2023-10-22 22:23:23 +00:00
function walk(dir) {
return readdirSync(dir, { withFileTypes: true }).flatMap((file) =>
file.isDirectory() ? walk(join(dir, file.name)) : join(dir, file.name),
);
}
2023-10-22 22:23:23 +00:00
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>