-
Notifications
You must be signed in to change notification settings - Fork 61
/
vite.config.js
56 lines (53 loc) · 1.16 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import { dirname, resolve } from "node:path"
import { fileURLToPath } from "node:url"
import react from "@vitejs/plugin-react"
// import { visualizer } from "rollup-plugin-visualizer";
import { defineConfig } from "vite"
import { VitePWA } from "vite-plugin-pwa"
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
export default defineConfig({
plugins: [
react(),
VitePWA({
registerType: "autoUpdate",
devOptions: {
enabled: true,
},
workbox: {
cleanupOutdatedCaches: true,
skipWaiting: true,
clientsClaim: true,
},
}),
// visualizer({
// gzipSize: true,
// }),
],
resolve: {
alias: {
"@": resolve(__dirname, "./src"),
},
},
server: {
host: "0.0.0.0",
port: 3000,
},
preview: {
host: "0.0.0.0",
port: 3000,
},
build: {
outDir: "build",
chunkSizeWarningLimit: 1000,
rollupOptions: {
output: {
manualChunks: {
arco: ["@arco-design/web-react"],
highlight: ["highlight.js"],
react: ["react", "react-dom", "react-router-dom"],
},
},
},
},
})