-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
add option to local-css to prefix minified classnames #3484
Comments
Yes i agree. I currently have encountered the same problem. Im building a javascript problem and it seems that another plugin already uses esbuild which causes css classes to overlap randomly. A simple prefix like lightningcss also allows to declare a prefix via their "pattern" option: https://lightningcss.dev/css-modules.html#custom-naming-patterns |
Hi, this is also an issue on some projects here. |
You can use another plugin for css modules - like mine ^^ https://github.com/mhsdesign/esbuild-plugin-lightningcss-modules its based on lightningcss |
@evanw, my team develops a browser extension, and I recently switched us to esbuild for the dramatic speed improvement. Thank you very much for writing this software. Our extension coexists in the DOM on many websites, and it is subject to these sites' global styling. I was troubleshooting a visual bug this week, and I noticed that Reddit uses a classname simply named Unfortunately, this conflicts with an We're currently working around this by not minifying our extension, but introducing an optional prefix for generated local-css classnames as configuration would solve this problem for us 100%. |
I have the same problem. I'm creating a powerful HTML element for my website builder, and every single HTML element has its own bundle. Now, when two or more elements with CSS modules are involved, it causes this issue. |
I just have a site with pre-existing CSS. Someone in the distant past decided to use a short class name. Now it conflicts with the minified class names from esbuild. So I'd also like to see an option in esbuild to prefix class names. |
I took a stab at this with #3914. It's working for me locally. I called the new setting |
link of original issue which was resolved: #3295
our main concern is avoiding classname conflict accross lib built separately
Our problem is the following
=> when B builds, B's stylesheet clashes with A's stylesheet, because we do not specify A as entrypoint, we just get the built files from A
What we would appreciate
The text was updated successfully, but these errors were encountered: