-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathvite.config.js
32 lines (30 loc) · 979 Bytes
/
vite.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { defineConfig, loadEnv } from "vite";
import { resolve } from "path";
import react from "@vitejs/plugin-react";
import forwardToTrailingSlashPlugin from "./forward-to-trailing-slash-plugin";
const build = {
rollupOptions: {
input: {
main: resolve(__dirname, "index.html"),
classes: resolve(__dirname, "classes/index.html"),
donate: resolve(__dirname, "donate/index.html"),
live: resolve(__dirname, "live/index.html"),
register: resolve(__dirname, "register/index.html"),
history: resolve(__dirname, "history/index.html"),
fscalendar: resolve(__dirname, "fscalendar/index.html"),
},
},
};
// https://vitejs.dev/config/
export default defineConfig(({ command, mode }) => {
const env = loadEnv(mode, process.cwd(), "");
return {
plugins: [
forwardToTrailingSlashPlugin(Object.keys(build.rollupOptions.input)),
react(),
],
base: env.VITE_BASE ?? "/",
appType: "mpa",
build,
};
});