gpt4 book ai didi

html - 更改 css 文件和 htmls 或 jade 中的 css 类名称的 Grunt 任务

转载 作者:行者123 更新时间:2023-11-28 05:33:35 27 4
gpt4 key购买 nike

我想知道是否有任何 Grunt 任务可以将类的名称更改为唯一的名称?

例如.container -> .uniqueName_container

或只是一些随机字母或数字,如 google:.container -> .jh72ab

但是在 html/jade 和 css 文件中都这样做吗?

最佳答案

这似乎支持使用函数输出替换值;您可以将用于生成标识符的代码放在那里。

https://github.com/yoniholmes/grunt-text-replace

例子:

replacements: [{
from: 'Foo',
to: function (matchedWord) { // callback replacement
return matchedWord + ' Bar';
}
}]

关于html - 更改 css 文件和 htmls 或 jade 中的 css 类名称的 Grunt 任务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38361024/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com