简体   繁体   English

Node.js-生成丑陋的类名

[英]Node.js - generate ugly class names

Is there a way to generate ugly class names? 有没有办法生成丑陋的类名? I mean if there's a plugin that I could use to replace .top-header class with .a9ev in my css. 我的意思是,如果有一个插件,我可以在CSS中使用.a9ev替换.a9ev .top-header类。 Also, would be great if class name in my html was also changed 另外,如果我的html中的类名也被更改,那将是很好的

How big sites like facebook or google do this? 像Facebook或Google这样的大网站有多少?

You may have some luck using one of these: 使用以下其中一种方法,您可能会有些运气:

Some of those are general tools and some of those like gulp-minify-cssnames are very specific tools that do one thing only - like minifying the CSS class names and IDs in this case. 其中一些是通用工具,而一些像gulp-minify-cssnames是非常特定的工具,它们仅做一件事-例如在这种情况下,最小化CSS类名和ID。

Make sure that you use the same versions of minified names across all of your code, ie that you reference the classes in HTML, CSS and in JavaScript by the same (minified - or uglyfied) names. 确保在所有代码中使用相同版本的最小名称,即,您使用相同(最小或丑陋的)名称引用HTML,CSS和JavaScript中的类。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM