feat(configuration): enhance Vite config for React and Ant Design integration

- Updated Vite configuration to ensure a single React instance and prevent context issues by adding 'react/jsx-runtime' to deduplication.
- Improved manual chunking strategy to keep React core together and optimize Ant Design component loading.
- Adjusted build settings for better source map handling and chunk size warnings.
- Centralized Ant Design imports in `antd-imports.ts` to ensure React is available for all components.
- Removed exclusions for Ant Design to enhance compatibility and performance.
This commit is contained in:
chamikaJ
2025-06-25 13:10:19 +05:30
parent 7b326e8ff0
commit f837ca6b23
2 changed files with 37 additions and 62 deletions

View File

@@ -7,6 +7,9 @@
* - Separate icon imports to avoid loading entire icon set
*/
// Ensure React is available for Ant Design components
import React from 'react';
// Core Components - Import as default exports for better tree-shaking
import Button from 'antd/es/button';
import Input from 'antd/es/input';
@@ -59,6 +62,7 @@ import theme from 'antd/es/theme';
// Re-export all components
export {
React, // Export React to ensure it's available
Button,
Input,
Select,