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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user