forked from noxious/client
41 lines
1.0 KiB
TypeScript
41 lines
1.0 KiB
TypeScript
import { fileURLToPath, URL } from 'node:url'
|
|
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue';
|
|
import viteCompression from 'vite-plugin-compression';
|
|
import {ViteImageOptimizer} from "vite-plugin-image-optimizer";
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
vue(),
|
|
viteCompression({
|
|
algorithm: 'gzip',
|
|
ext: '.gz',
|
|
threshold: 10240 // Only compress files larger than 10KB
|
|
}),
|
|
ViteImageOptimizer()
|
|
],
|
|
build: {
|
|
minify: 'terser', // Better minification
|
|
terserOptions: {
|
|
compress: {
|
|
drop_console: true, // Remove console.log in production
|
|
drop_debugger: true
|
|
}
|
|
},
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks: {
|
|
'vendor': ['vue'], // Split vendor chunks
|
|
// Add other large dependencies here
|
|
}
|
|
}
|
|
},
|
|
chunkSizeWarningLimit: 1000, // Increase chunk size warning limit if needed
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
}
|
|
}
|
|
}) |