2 years ago

#72296

test-img

Serio

Is there a way to minify css classNames?

I wanna make some obfuscation and minification by changing my css class-names. As I don't think this is a right way to minify it by myself, so I'm using css modules with

getLocalIdent: MinimalClassnameGenerator({ length: 1 })
//where MinimalClassnameGenerator is webpack-minimal-classnames

and it works at css side, class names is minified. But unfortunately at output.bundle.js I've found lines like this

 const N = { class: "super-puper-class" },
[
          "__cssModules",
          {
            $style: {
              "super-puper-class": "J",

It means that only css side is minified and somebody could know real class name after compilation. Is there a way to minify and obfuscate classNames right?

node.js

webpack

css-modules

0 Answers

Your Answer

Accepted video resources