Build photo.html with vite
This commit is contained in:
parent
4ab15ab61a
commit
ad028bc522
2 changed files with 45 additions and 34 deletions
|
|
@ -137,8 +137,7 @@
|
|||
flip.setAttribute("href", `?facing=${facingOpposite}`);
|
||||
}
|
||||
|
||||
await initStream(facing);
|
||||
|
||||
initStream(facing).then(() => {
|
||||
async function waitAtLeast(duration, since) {
|
||||
const now = Date.now();
|
||||
const wait = duration - (now - since);
|
||||
|
|
@ -172,6 +171,7 @@
|
|||
cover.classList.add("hidden");
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
||||
|
|
@ -1,14 +1,25 @@
|
|||
import vue from "@vitejs/plugin-vue";
|
||||
import { fileURLToPath, URL } from "node:url";
|
||||
import { dirname, resolve } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { defineConfig } from "vite";
|
||||
import vueDevTools from "vite-plugin-vue-devtools";
|
||||
|
||||
const root = dirname(fileURLToPath(import.meta.url));
|
||||
function path(to: string): string {
|
||||
return resolve(root, to);
|
||||
}
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [vue(), vueDevTools()],
|
||||
base: "",
|
||||
build: {
|
||||
rollupOptions: {
|
||||
input: [path("index.html"), path("photo.html")],
|
||||
},
|
||||
},
|
||||
resolve: {
|
||||
alias: { "@": fileURLToPath(new URL("./src", import.meta.url)) },
|
||||
alias: { "@": path("src") },
|
||||
},
|
||||
server: {
|
||||
proxy: { "/api": "http://localhost:8080" },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue