-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
41 lines (40 loc) · 1.12 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
import react from "@vitejs/plugin-react";
import path from "path";
import { defineConfig } from "vite";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
build: {
minify: "terser",
terserOptions: {
compress: {
drop_console: true,
drop_debugger: true,
},
format: {
comments: false,
},
},
rollupOptions: {
output: {
manualChunks: {
// Separa le librerie React in un chunk dedicato
"react-vendor": ["react", "react-dom", "react-router-dom"],
// Separa le librerie UI in un altro chunk
"ui-vendor": ["@nextui-org/react", "framer-motion"],
// Separa le librerie di form in un altro chunk
"form-vendor": ["formik", "yup", "@formspree/react"],
// Separa le librerie di markdown in un altro chunk
"markdown-vendor": ["react-markdown", "rehype-raw", "remark-gfm"],
},
},
},
// Aumenta il limite di warning per i chunk
chunkSizeWarningLimit: 1000,
},
});