fixes for site

This commit is contained in:
Desktop
2025-11-13 18:42:53 +05:00
parent 86f6886a13
commit a9e8d6fe2d
4 changed files with 59 additions and 37 deletions

View File

@@ -6,6 +6,7 @@ import { resolve } from "path";
// https://vite.dev/config/
export default defineConfig(({ mode }) => {
const isDev = mode === "development";
const isMarketingBuild = mode === "marketing";
return {
plugins: [
@@ -23,27 +24,26 @@ export default defineConfig(({ mode }) => {
optimizeDeps: {
include: [
// Only pre-bundle frequently used, small dependencies
'clsx',
'tailwind-merge',
'zustand',
// Include apexcharts for proper module resolution
'apexcharts',
'react-apexcharts',
"clsx",
"tailwind-merge",
"zustand",
// Include apexcharts for proper module resolution (skip during marketing-only build)
...(isMarketingBuild ? [] : ["apexcharts", "react-apexcharts"]),
],
// Exclude heavy dependencies that are only used in specific pages
// They will be lazy-loaded when needed
exclude: [
'@fullcalendar/core',
'@fullcalendar/daygrid',
'@fullcalendar/interaction',
'@fullcalendar/list',
'@fullcalendar/react',
'@fullcalendar/timegrid',
'@react-jvectormap/core',
'@react-jvectormap/world',
'react-dnd',
'react-dnd-html5-backend',
'swiper',
"@fullcalendar/core",
"@fullcalendar/daygrid",
"@fullcalendar/interaction",
"@fullcalendar/list",
"@fullcalendar/react",
"@fullcalendar/timegrid",
"@react-jvectormap/core",
"@react-jvectormap/world",
"react-dnd",
"react-dnd-html5-backend",
"swiper",
],
esbuildOptions: {
target: 'es2020',
@@ -57,10 +57,14 @@ export default defineConfig(({ mode }) => {
cssCodeSplit: true,
// Optimize chunk size
rollupOptions: {
input: {
main: resolve(__dirname, "index.html"),
marketing: resolve(__dirname, "marketing.html"),
},
input: isMarketingBuild
? {
marketing: resolve(__dirname, "marketing.html"),
}
: {
main: resolve(__dirname, "index.html"),
marketing: resolve(__dirname, "marketing.html"),
},
output: {
// Manual chunk splitting for better code splitting
manualChunks: (id) => {