Convert clsx import to clsx/lite
See for why https://twitter.com/lukeed05/status/1740841680364773646
It would help reduce the bundle size on Material UI's side: https://github.com/mui/material-ui/issues/40366.
cc @lukeed
+1 here. I meant to link to this plugin in the tweet but forgot to 🤦♂️ this plugin is a perfect match & furthers why clsx/lite was good to have
Altho the way (I think) this plugin works, “clsx/lite” just needs to be defined in options.libraries — either the users or default options
Convert clsx import to clsx/lite
The plugin could only do that when it knows the value is a string but when it knows that it just removes the function call: https://github.com/merceyz/babel-plugin-optimize-clsx/tree/bdd548fd2d4314385d62564dcfe124d9d461db0e#unnecessary-function-calls
In the example from the clsx release, from the plugins perspective, props.className could be anything.
props.className could be anything
true, altho 99% safe bet is string