-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvite.config.js
More file actions
65 lines (64 loc) · 1.71 KB
/
vite.config.js
File metadata and controls
65 lines (64 loc) · 1.71 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
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
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import path from "path";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
test: {
environment: "jsdom",
globals: true,
},
css: {
preprocessorOptions: {
scss: {
api: "modern-compiler",
silenceDeprecations: ["import", "if-function"],
},
},
lightningcss: {
// Allow invalid media queries (e.g. var() in media queries from Bulma)
errorRecovery: true,
},
},
resolve: {
alias: [
{
find: "@",
replacement: path.resolve(__dirname, "./src"),
},
{
find: /^~/,
replacement: "node_modules/",
},
],
},
build: {
// Disable modulepreload to avoid CORS issues with crossorigin attribute
modulePreload: false,
rollupOptions: {
output: {
manualChunks(id) {
// Keep ECharts and vue-echarts together to avoid initialization issues
if (id.includes("node_modules/echarts") || id.includes("node_modules/vue-echarts")) {
return "echarts";
}
// Split Oruga UI
if (id.includes("node_modules/@oruga-ui")) {
return "oruga";
}
// Split moment.js
if (id.includes("node_modules/moment")) {
return "moment";
}
// Keep Firebase with vendor to avoid circular dependency issues
if (id.includes("node_modules")) {
return "vendor";
}
},
},
},
// ECharts is inherently large (~1.5MB), but gzips well to ~515KB
// This is acceptable for a charting library with lazy loading
chunkSizeWarningLimit: 1600,
},
});