This repository has been archived by the owner on Nov 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
vite.config.ts
executable file
·67 lines (65 loc) · 1.78 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
import dotenv from "dotenv";
dotenv.config({ path: "../Blacket/.env" });
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
"@components": "/src/components",
"@functions": "/src/functions",
"@stores": "/src/stores",
"@styles": "/src/styles"
},
preserveSymlinks: true
},
server: {
proxy: {
"/api": {
target: process.env.VITE_BACKEND_URL,
changeOrigin: true
}
}
},
css: {
modules: {
scopeBehaviour: "local",
localsConvention: "camelCaseOnly",
generateScopedName: "[name]__[local]___[hash:base64:5]"
}
},
build: {
target: "es2022",
outDir: "./dist",
rollupOptions: {
output: {
manualChunks: (id: any) => {
if (id.includes("node_modules")) return "vendor";
else return "main";
},
chunkFileNames: "[name].[hash].js",
entryFileNames: "[name].[hash].js",
assetFileNames: "[name].[hash].[ext]"
}
},
chunkSizeWarningLimit: 1000,
manifest: true,
minify: "terser",
terserOptions: {
format: {
comments: false
},
compress: {
sequences: true,
booleans: true,
loops: true,
toplevel: true,
unsafe: true,
drop_console: true,
unsafe_comps: true,
passes: 2
},
module: true
}
}
});