-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
36 lines (35 loc) · 1.1 KB
/
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
33
34
35
36
import { defineConfig } from "vite";
import { resolve } from "path";
import react from "@vitejs/plugin-react";
// https://vitejs.dev/config/
export default defineConfig({
base: "/",
build: {
outDir: "./dist_hub",
rollupOptions: {
input: {
spawn: resolve(__dirname, "spawn.html"),
login: resolve(__dirname, "login.html"),
spawn_pending: resolve(__dirname, "spawn_pending.html"),
home: resolve(__dirname, "home.html"),
not_running: resolve(__dirname, "not_running.html"),
},
output: {
entryFileNames: "static/custom-js/[name]-[hash].js",
chunkFileNames: "static/custom-js/[name]-[hash].js",
assetFileNames: ({ name }) => {
if (/\.(css)$/.test(name ?? "")) {
return "static/custom-css/[name]-[hash][extname]";
} else if (/\.(png|jpe?g|gif|svg)$/.test(name ?? "")) {
return "static/custom-css/[name]-[hash][extname]";
}
return "static/[ext]/[name]-[hash][extname]";
},
},
},
},
plugins: [react()],
server: {
open: process.env.ENTRY,
},
});