cmsmanage/vite.config.js

30 lines
667 B
JavaScript
Raw Permalink Normal View History

import path from "node:path";
2024-07-22 19:02:17 -04:00
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;
}
2024-07-22 19:02:17 -04:00
export default defineConfig({
base: "/static/",
server: {
origin: "http://localhost:5173",
},
build: {
manifest: "manifest.json",
outDir: path.resolve("./vite-dist"),
rollupOptions: { input: inputs },
2024-07-22 19:02:17 -04:00
},
});