material-ui
material-ui copied to clipboard
[docs] Add Vite/Vitest configuration for styled-components
Fixes #46586
Summary
Added documentation for Vite/Vitest configuration when using styled-components with MUI v7+, addressing ESM/CJS compatibility issues.
Changes
- Added new "Configuration with Vite and Vitest" section
- Documented two approaches:
fallbackCJS(simpler) andinlinedependencies (faster) - Included performance notes and best practices based on community feedback in the issue thread
Related Issues
- Closes #46586
I've submitted a PR to add the Vite/Vitest configuration to the styled-components documentation.
The documentation now includes both the fallbackCJS and inline dependency options discussed in this thread, with notes on performance differences.
Netlify deploy preview
Bundle size report
| Bundle | Parsed size | Gzip size |
|---|---|---|
| @mui/material | 0B(0.00%) | 0B(0.00%) |
| @mui/lab | 0B(0.00%) | 0B(0.00%) |
| @mui/system | 0B(0.00%) | 0B(0.00%) |
| @mui/utils | 0B(0.00%) | 0B(0.00%) |
Generated by :no_entry_sign: dangerJS against 3c523878143d54169f5fdd83fdc7b4426fea0b28