在当前项目中,我被要求在部署之前压缩HTML class属性和相应的CSS选择器。例如,生产环境中的代码如下:
<div class="foo">
<div id="bar"></div>
</div>
.foo {/*Style goes here*/}
#bar {/*Style goes here*/}
在部署时,我希望HTML类和相应的CSS选择器被替换:
<div class="a">
<div id="b"></div>
</div>
.a {/*Style goes here*/}
#b {/*Style goes here*/}
有哪些可用的工具可以完成这种压缩?