HTML comments causing an issue exporting CSS files with Grunt-usemin

倾然丶 夕夏残阳落幕 提交于 2019-12-22 22:19:04

问题


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!


回答1:


Upgrade to v2.0. For that functionality.



来源:https://stackoverflow.com/questions/19863385/html-comments-causing-an-issue-exporting-css-files-with-grunt-usemin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!