-
-
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
[core] Fix ESM issues with regression tests #37963
Conversation
Netlify deploy previewhttps://deploy-preview-37963--material-ui.netlify.app/ Bundle size report |
This reverts commit a834adc.
@@ -32,11 +33,12 @@ module.exports = { | |||
rules: [ | |||
{ | |||
test: /\.(js|ts|tsx)$/, | |||
exclude: /node_modules/, | |||
exclude: /node_modules|prism\.js/, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we excluding this so that it picks the prism.mjs
(ES Module) file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's because @mui/markdown/prism
gets imported in several contexts, both ESM and Commonjs. It's a commonjs file but webpack resolves it as ESM and fails to find exports. Ideally we move this to ESM as well, but I don't want to expand the scope of this PR further
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm adding a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work. Looks great! This marks one of the steps in the overall support for ES Modules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Closes #37888
It's an alternative to #37888 (comment) in that it stops babel from compiling modules down to commonjs for the regression tests. The goal will be to do this for all targets (
usesEsModules = true
).Included in this PR:
react-imask