-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
44 lines (41 loc) · 1.26 KB
/
vite.config.ts
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
38
39
40
41
42
43
44
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
server: {
host: "0.0.0.0",
open: "http://localhost:3000/",
port: 3000,
strictPort: true,
watch: {
usePolling: true,
},
},
build: {
// Only warn when our build exceeds 1000kB
chunkSizeWarningLimit: 1000,
minify: "terser",
terserOptions: {
ecma: 2020,
},
rollupOptions: {
output: {
manualChunks: (id) => {
// Use this for getting the file name (DEV_ONLY)
const fileNameRegex = /^.*\/(.*)\..*$/;
// Split node_modules into vendors
if (id.includes("node_modules")) {
// Use this for getting the package name (DEV_ONLY)
const packageName = id
.toString()
.split("node_modules/")[1]
.split("/")[0]
.toString();
return "vendor";
}
},
},
},
},
});