2024-07-24 01:48:59 -04:00
|
|
|
import path from "node:path";
|
2024-07-22 19:02:17 -04:00
|
|
|
import { defineConfig } from "vite";
|
2024-07-24 01:48:59 -04:00
|
|
|
import { globbySync } from "globby";
|
|
|
|
|
|
|
|
const entry_points = globbySync("*/js/*.entry.ts", { gitignore: true });
|
|
|
|
|
|
|
|
const inputs = {
|
|
|
|
base: "./js/base.entry.ts",
|
2024-07-24 20:01:27 -04:00
|
|
|
"bootstrap-css-only": "./js/bootstrap-css-only.entry.ts",
|
2024-07-24 01:48:59 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
for (const entry of entry_points) {
|
|
|
|
inputs[
|
|
|
|
path.dirname(path.dirname(entry)) + "/" + path.basename(entry, ".entry.ts")
|
|
|
|
] = entry;
|
|
|
|
}
|
2024-07-22 19:02:17 -04:00
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
base: "/static/",
|
|
|
|
|
|
|
|
server: {
|
|
|
|
origin: "http://localhost:5173",
|
|
|
|
},
|
|
|
|
build: {
|
|
|
|
manifest: "manifest.json",
|
2024-07-24 01:48:59 -04:00
|
|
|
outDir: path.resolve("./vite-dist"),
|
|
|
|
rollupOptions: { input: inputs },
|
2024-07-22 19:02:17 -04:00
|
|
|
},
|
|
|
|
});
|