-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
37 lines (35 loc) · 1.03 KB
/
Copy pathvite.config.js
File metadata and controls
37 lines (35 loc) · 1.03 KB
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
37
import { defineConfig } from "vite";
const PascalIndex = () => ({
name: "pascal-index",
configureServer(server) {
server.middlewares.use((req, _res, next) => {
const [path, query] = req.url.split("?");
if (path === "/" || path === "/index.html")
req.url = "/Index.html" + (query ? "?" + query : "");
next();
});
},
configurePreviewServer(server) {
server.middlewares.use((req, _res, next) => {
const [path, query] = req.url.split("?");
if (path === "/" || path === "/index.html")
req.url = "/Index.html" + (query ? "?" + query : "");
next();
});
},
});
export default defineConfig({
base: "./",
publicDir: "Public",
plugins: [PascalIndex()],
build: {
rollupOptions: {
input: "Index.html",
output: {
// vendor split: the app shell parses while ez-tree's inlined bark
// JPEGs (the bulk of the old 4.6MB single chunk) still stream
manualChunks: { three: ["three"], eztree: ["@dgreenheck/ez-tree"] },
},
},
},
});