使用gulp缩小HTML注释中使用的条件语句

使用gulp缩小HTML注释中使用的条件语句,gulp,Gulp,我想缩小以下HTML代码。我使用的是gulp cleanhtml,它对我来说很好,除了以下提到的标准: 它不会缩小HTML条件语句的样式。检查以下代码: <!--[if gte mso 9]> <style> sup { font-size:100% !important; } </style> <![endif]--> 有人能指导我怎么走吗?这样我就可以缩小那些条件语句中的代码了?gulp htmlmin应该

我想缩小以下HTML代码。我使用的是gulp cleanhtml,它对我来说很好,除了以下提到的标准:

它不会缩小HTML条件语句的样式。检查以下代码:

<!--[if gte mso 9]>
<style> 
sup 
   {   
     font-size:100% !important;
   }
</style>
<![endif]-->


有人能指导我怎么走吗?这样我就可以缩小那些条件语句中的代码了?

gulp htmlmin
应该可以通过以下选项实现:

.pipe(
    htmlmin({
        collapseWhitespace: true,
        minifyCSS: true,
        processConditionalComments: true,
    })
)
这将导致:

<!--[if gte mso 9]><style>sup{font-size:100%!important}</style><![endif]-->


minifyCss
修改为
minifyCss
非常感谢!这真的很有帮助。