build-plugin-minify-classname

0.2.0 • Public • Published

build-plugin-minify-classname

Minify your css modules classnames to get a smaller bundle size

Usage

{
  "plugins": [
    // ...
   "build-plugin-minify-classname"
  ]
}

How

If we have a css modules file named src/components/button/index.module.scss

Suppose there are many selectors in it

.foo {}
.bar {}
// ...

The result in miniapp projects

.a-a_mc {}
.b-a_mc {}
// ...

The result in other projects

.a54755bb1 {}
.b54755bb1 {}
// ...

Why not [hash:base64:7]

As 54755bb1 here is repeated many times, it's better for gzip-like algorithm to generate a smaller size bundle

Readme

Keywords

none

Package Sidebar

Install

npm i build-plugin-minify-classname

Weekly Downloads

10

Version

0.2.0

License

BSD-3-Clause

Unpacked Size

7.75 kB

Total Files

7

Last publish

Collaborators

  • boiawang
  • rax-publisher