[code-infra] Remove usage of NODE_ENV=test#47692
Open
Janpot wants to merge 10 commits intomui:masterfrom
Open
Conversation
Netlify deploy previewhttps://deploy-preview-47692--material-ui.netlify.app/ Bundle size report
|
brijeshb42
reviewed
Jan 30, 2026
|
|
||
| if (process.env.NODE_ENV === 'test') { | ||
| plugins.push([ | ||
| 'babel-plugin-module-resolver', |
Contributor
There was a problem hiding this comment.
Can be removed from package.json as well
Member
Author
There was a problem hiding this comment.
It's seems to still be in use by "coverage" and "development", but I believe we can get rid of these as well, will do as a separate PR as to not conflate concerns.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mandate NODE_ENV to be a binary option
production/development. It's being used for tree-shaking purposes, let's not conflate with other concerns. That keeps it easy to reason about.Where really needed we'll do
process.env.NODE_ENV !== 'production' && globalThis.MUI_TEST_ENV.We use
globalThis.MUI_TEST_ENVbecause it allows us to keep it in the bundle, but not introduce a variable that's not set on the end-user's side. We want it in the bundle because MUI X relies on it as well.It seems to be mostly used to enable testing some things under jsdom. I'm inclined to make those tests browser-only