-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve support for using @mui in vitest with explicit exports
in package.json
for ESM support
#45495
Comments
These are the patch files I'm using if they help: @mui+icons-material+6.4.5.patch NOTE: I am stuck on 6.4.5 for |
Please try whether
Unfortunately we can't backport this to v6 as it's a breaking change. |
@Janpot I give it a try, but you it's still in beta, right? We were planning on updating once it is released. I can't tell whether there are any breaking changes |
It's still in beta yes, that's also why your feedback would be very valuable, if you have the time to try it out. A stable release is planned at the end of the month. From your snippets I can already tell you that we won't be supporting |
Those were needed to solve some of the ways Are there any breaking changes I should be aware of? Any migration guides I can reference? |
Summary
According to this vitest discussion they resolve nested inclusion of libraries via the
main
block inpackage.json
unless explicitexports
block exists with explicitimport
definitions. As a result, I've had to patch@mui/utils
,@mui/system
,@mui/material
,@mui/icons-material
and@mui/styled-engine
to add these explicitexports
.I'd love NOT to have to do this and have your libraries build them in.
Thanks
Examples
Here's what I've added to
@mui/material
:And what I've added to
@mui/utils
:and
@mui/system
:And
@mui/styled-engine
:And a small addition to the
exports
in@mui/icons-material
:Motivation
We are switching our testing system from
jest
tovitest
because of it's superior ESM support due to a bunch of our dependencies switching to ESM only. We have built a bunch of our own internal libraries which are using@mui
and@rjsf
together. We encountered this issue in a conversion of a library that uses both.Thanks for a quick resolution
Search keywords: vitest ES Modules
The text was updated successfully, but these errors were encountered: