Open mpech opened 10 months ago
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 my-vendor
would be perfect.
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. I didn't find a way to intercept renaming through a plugin. If anybody has a temporary solution, it would be helpful. In the meanwhile, we will disable the minify option.
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 .a
. (Perhaps it is even generated by esbuild.)
Unfortunately, this conflicts with an .a
classname generated by our esbuild during local-css's minification process, and it messes up our extension's styling when it is rendered on Reddit.
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 local-css-prefix
.
link of original issue which was resolved: https://github.com/evanw/esbuild/issues/3295
our main concern is avoiding classname conflict accross lib built separately
Our problem is the following
What we would appreciate