Fix TypeScript build errors
This commit is contained in:
@@ -14,6 +14,7 @@ export default defineConfig({
|
||||
'@/utils': path.resolve(__dirname, './src/utils'),
|
||||
'@/types': path.resolve(__dirname, './src/types'),
|
||||
'@/constants': path.resolve(__dirname, './src/constants'),
|
||||
'@/config': path.resolve(__dirname, './src/config'),
|
||||
},
|
||||
},
|
||||
server: {
|
||||
@@ -25,5 +26,29 @@ export default defineConfig({
|
||||
},
|
||||
},
|
||||
},
|
||||
build: {
|
||||
// Optimize build output
|
||||
target: 'esnext',
|
||||
minify: 'esbuild',
|
||||
sourcemap: false, // Set to true for production debugging if needed
|
||||
rollupOptions: {
|
||||
output: {
|
||||
// Manual code splitting for better caching
|
||||
manualChunks: {
|
||||
// Vendor chunks
|
||||
'react-vendor': ['react', 'react-dom', 'react-router-dom'],
|
||||
'query-vendor': ['@tanstack/react-query'],
|
||||
'ui-vendor': ['recharts', 'react-icons', 'react-hot-toast'],
|
||||
'utils-vendor': ['axios', 'zod', 'date-fns', 'clsx', 'zustand'],
|
||||
},
|
||||
},
|
||||
},
|
||||
// Chunk size warning limit (1MB)
|
||||
chunkSizeWarningLimit: 1000,
|
||||
},
|
||||
// Optimize dependencies
|
||||
optimizeDeps: {
|
||||
include: ['react', 'react-dom', 'react-router-dom', '@tanstack/react-query'],
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user