material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

[docs] Add Vite/Vitest configuration for styled-components

Open rpgjarman opened this issue 3 months ago • 2 comments

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) and inline dependencies (faster)
  • Included performance notes and best practices based on community feedback in the issue thread

Related Issues

  • Closes #46586

rpgjarman avatar Oct 07 '25 03:10 rpgjarman

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.

rpgjarman avatar Oct 07 '25 03:10 rpgjarman

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%)

Details of bundle changes

Generated by :no_entry_sign: dangerJS against 3c523878143d54169f5fdd83fdc7b4426fea0b28

mui-bot avatar Oct 07 '25 03:10 mui-bot