mui / material-ui

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.
https://mui.com/material-ui/
MIT License
93.64k stars 32.22k forks source link

Minimize styles on the production #17470

Closed kodermax closed 5 years ago

kodermax commented 5 years ago

Why are styles on production not minimized? image

oliviertassinari commented 5 years ago

Why should they be?

kodermax commented 5 years ago

An improved website speed is an obvious reason to minify CSS.

oliviertassinari commented 5 years ago

If you have a layer of cache, for instance, if you are using Gatsby. You can apply minification. You have an example with our documentation: https://github.com/mui-org/material-ui/blob/c755854a74bf6d9ddabc2e5448b4ea0a925a695e/docs/pages/_document.js#L141

and in out Gatsby plugin: https://github.com/hupe1980/gatsby-plugin-material-ui/blob/b83a7eea369271ea947b8b0228e904f343613a09/gatsby-plugin-material-ui/src/gatsby-ssr.js#L44

oliviertassinari commented 5 years ago

As of now, we depend on https://github.com/cssinjs/jss, we don't apply any transformations on the generated styles. It seems that we will have better handling of the concern for free with #6115.