-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
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
Prevent MUI from optimizing class names in prod #8996
Comments
Wow, it's very weird! It's hard to tell what's going on without a reproduction repository.
People can provide their own class name generator with the |
@oliviertassinari ive got the opposite issue currently in my production build (also using the kriasoft starter kit) where the stylesheets have been optimized correctly, but the development classes are on the dom elements (see here). ive also followed the guide in the css-in-js docs almost to a t. any ideas? also, sorry for commenting on a closed issue, but it is the most relevant one that ive found |
in case anyone finds this in the future and you're experiencing something similar, see this issue in webpack. that will take care of it for you |
@mlg87 In the case of SSR, it means your server isn't configured for production, only the client is. |
I would like to prevent MUI from optimising classNames:
development:
.MuiAppBar-root-12
production: `.c12``
documentation: https://material-ui.com/customization/css-in-js/#class-names
I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior
With
NODE_ENV=production
MUI optimizes the names, which is cool, but I am using MUI with https://github.com/kriasoft/react-starter-kit and (it may be configuration noobness), but I am seeing the following code being generated. Class names in HTML optimised, but styles not optimised:I've been through the documentation trying to figure out how to disable the class name optimisation but can't find anything. Should there be a configuration flag, or am I missing something? As a side note I'm doing this side project to cut some learning curve, so I may be missing something obvious.
Your Environment
current dependencies, is mostly the stuff from here https://github.com/kriasoft/react-starter-kit, except with an added material ui:
Any help or direction would be great. And thanks for the hand.
The text was updated successfully, but these errors were encountered: