Best practice to compress css selector names?
See original GitHub issueWhat problem does this feature solve?
Hello. First, thank you for working on this useful tool.
My story: I tried to find information how to implement css selector name compression to reduce size of bundle, but I found only this article, which seems bit outdated: https://medium.com/@my_own_grave/reducing-css-generated-by-vue-loader-by-using-classnames-shorten-trick-aa1d25d77473
Is there a good solution for this task nowadays, or maybe someone solved it without monkey-patching css-loader? If it is solved somehow, I would like to see any example. I think, it would be great if vue-cli can provide such functionality.
Thanks in advance.
What does the proposed API look like?
I suggest to add some option to vue.config.js that will enable css class name compresion, such as: compressCssClassNames: true
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:7 (3 by maintainers)
Top Results From Across the Web
The complete best practices for minifying CSS - LogRocket Blog
Minifying CSS files is more nuanced than you might think at first. Learn the various minification tools, how to determine and remove unused ......
Read more >Before deployment, is there tool to compress HTML class ...
This will minify all CSS selectors in HTML, JS and CSS files (actually any file you want). I saved 20ish% of the CSS...
Read more >Reducing CSS bundle size 70% by cutting the class names ...
There is one thing a minifier cannot do – change the selector names. This is because a CSS minifier does not control the...
Read more >How I Reduced My CSS Bundle Size By More Than 20%
Generating the short names. The next step is to actually generate the valid minified selectors for use. First we define the ...
Read more >10 Best Practices for Quickly Improving Your CSS - Webtips
CSS has its own nuances that can make or break your design. Here are 10 tips for CSS : best practices that can...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can simply add your own getLocalIdent function to the css loader options like this:
@LinusBorg thank you. Closing this issue.