HTML注释导致使用Grunt-usemin导出CSS文件的问题 [英] HTML comments causing an issue exporting CSS files with Grunt-usemin

查看:124
本文介绍了HTML注释导致使用Grunt-usemin导出CSS文件的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用yeoman / grunt来进行构建过程,并且遇到了一个问题。我正在尝试构建两个.css文件,一个用于IE8,另一个用于其他所有文件。如果我将IE的条件放置在构建块的外部,则由于评论中的评论而引发错误。如果我把IE的条件放在里面,它会被剥离掉。

I'm using yeoman/grunt to for my build process and I'm running into an issue. I'm trying to build two .css files, one for IE8 and one for everything else. If I place the IE conditional on the outside of the build block, an error is thrown because of the comment within a comment. If I put the IE conditional on the inside it gets stripped out.

    <!--[if lte IE 8]>
    <!-- build:css({.tmp,app}) styles/main-old-ie.css -->
        <link rel="stylesheet" href="styles/main-old-ie.css">
    <!-- endbuild -->
    <![endif]-->

    <!--[if gt IE 8]><!-->
    <!-- build:css({.tmp,app}) styles/main.css -->
    <link rel="stylesheet" href="styles/main.css">
    <!-- endbuild -->
    <!--<![endif]-->

是否有另一种/更好/更简单的方式来做到这一点?

Is there another/better/easier way of doing this?

谢谢!

Thanks!

推荐答案

升级到v2.0。为此功能。

Upgrade to v2.0. For that functionality.

这篇关于HTML注释导致使用Grunt-usemin导出CSS文件的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆