sndyuk/mangle-css-class-webpack-plugin

Bulma css support

IRediTOTO opened this issue · 4 comments

Hi, I am use regex like this

classNameRegExp: (bm-[a-zA-Z-]([a-zA-Z0-9-]*([\\\\\\\\]*(\\%|\\#|\\.|\\[|\\]))*)*',

but they missing classname on css files
example
the class name like this will be missed

.button.is-primary {....};

it will be transformed to:

a.b {...};  // lost dot '.' charactor in css file. 

in HTML everything look fine
Can you please take a look? Is this error come from my regex ? I tried to test but regex is fine
image

@IRediTOTO It looks weird. Can I get the log from the plugin?

P.S \\\\\\\\ should be \\\\.
ref. If you want to use the back slash \ on the regexp, use [\\\\]* to match class names contained both JS(\\\\) and CSS(\\\\\\\\\\\\\\\\). (README.md)

@IRediTOTO It looks weird. Can I get the log from the plugin?

P.S \\\\\\\\ should be \\\\. ref. If you want to use the back slash \ on the regexp, use [\\\\]* to match class names contained both JS(\\\\) and CSS(\\\\\\\\\\\\\\\\). (README.md)

I made an example here. Can you take a look ?
https://stackblitz.com/edit/nextjs-zyujh2?file=pages/index.js
just need npm run dev is ok

@IRediTOTO I've checked the styles/bulma.css file. It doesn't contain any complex class. I think you can just put the simple regex.

classNameRegExp: '(bm-)[a-zA-Z-][a-zA-Z0-9-]*',

Isn't it working?

@sndyuk thank you so much 💯