Closed b6pzeusbc54tvhw5jgpyw8pwz2x6gs closed 8 years ago
[...] does babel-plugin-css-in-js always guarantee to create the same class name? Even when I use compressClassName option [...]
Yes, this is garanteed. The plugin internally uses a classname cache on disk to ensure this property. The example directory contains a universal app where classnames are compiled on both the client and the server side.
Thanks for answering my question. Much as I think, this plugin is an awesome!
Recently, I'm working on the study about universal app like react-redux-universal-hot-example. As far as I know, in universal app, js files are loaded from different ways on each server and client side. Server side use the
babel-register
but client side use a bundle js file from webpack.I have a question. Assuming that my code state haven't changed and use the same babelrc and options, regardless of the loading method(babel-register or webpack), does
babel-plugin-css-in-js
always guarantee to create the same class name? Even when I use compressClassName option, always guarantee it?