30 lines
667 B
JavaScript
30 lines
667 B
JavaScript
import path from "node:path";
|
|
import { defineConfig } from "vite";
|
|
import { globbySync } from "globby";
|
|
|
|
const entry_points = globbySync("*/js/*.entry.ts", { gitignore: true });
|
|
|
|
const inputs = {
|
|
base: "./js/base.entry.ts",
|
|
"bootstrap-css-only": "./js/bootstrap-css-only.entry.ts",
|
|
};
|
|
|
|
for (const entry of entry_points) {
|
|
inputs[
|
|
path.dirname(path.dirname(entry)) + "/" + path.basename(entry, ".entry.ts")
|
|
] = entry;
|
|
}
|
|
|
|
export default defineConfig({
|
|
base: "/static/",
|
|
|
|
server: {
|
|
origin: "http://localhost:5173",
|
|
},
|
|
build: {
|
|
manifest: "manifest.json",
|
|
outDir: path.resolve("./vite-dist"),
|
|
rollupOptions: { input: inputs },
|
|
},
|
|
});
|