-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.ts
39 lines (37 loc) · 1.11 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
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import { fileURLToPath, URL } from 'node:url'
import vueDevTools from 'vite-plugin-vue-devtools'
import ViteYaml from '@modyfi/vite-plugin-yaml';
// https://vite.dev/config/
export default defineConfig({
plugins: [vue(), vueJsx(), vueDevTools(), ViteYaml()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
},
},
server: {
port: 9721,
open: true,
},
build: {
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes('node_modules')) {
const packageName = id.toString().split('node_modules/')[1].split('/')[0];
if (packageName && packageName !== 'vue' && packageName !== 'vue-demi') {
return `pkg-${packageName}`; // Each dependency gets its own chunk
}
}
if (id.includes('/src/')) {
return 'app'; // Your app's components
}
}
},
},
chunkSizeWarningLimit: 10000, // Suppress warnings for larger chunks
},
})