Skip to content

default localIdentName performs poorer than a composed one #406

@enapupe

Description

@enapupe

I did some changes on my webpack config file in order to optimize generated css file size. The first move was removing my custom localIdentName and use css-loader's default. Surprisingly, [hash:base64] performs poorer than [name][local][hash:base64:5] considering gzip size.

That's probably because the default hash length is 23 (unique characters) and gzip can't do much about that kind of data (unique). Using a composed localIdentName with a smaller hash portion leaves more space for gzip to work.

Do you guys think it's possible to change the default option? I understand that hash:base64 is probably the safest option but maybe we could get to another safe combination that also has better compression.

FYI this is what I'm getting at this project:

  • bundled css total file size:
[hash:base64] [name][local][hash:base64:5]
raw 137kb 139kb
gzip 44kb 27kb

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions