import { defineConfig } from "vite"; // One multi-page site: src/index.html (landing page) and one page per app in // src//index.html, served at //. Shared code goes in src/common/. // Relative asset paths, so the build works wherever the site is served // (an origin root or a ///site/ path); ES module workers. const page = (p: string) => decodeURIComponent(new URL(`./src/${p}`, import.meta.url).pathname); export default defineConfig({ root: "src", base: "./", worker: { format: "es" }, build: { outDir: "../dist", emptyOutDir: true, rolldownOptions: { input: { main: page("index.html"), "double-pendulum": page("double-pendulum/index.html"), "fput-chain": page("fput-chain/index.html"), }, }, }, });