繁体   English   中英

grunt版本出现“ Broken @import”错误?

[英]“Broken @import” error with grunt build?

我正在尝试构建我的第一个角度应用程序。 我正在使用yeoman和angular-generator。 该应用程序通过“ grunt serve”运行良好,但是当我运行“ grunt build”时,该过程因错误而停止-

Running "cssmin:generated" (cssmin) task
Warning: Broken @import declaration of "" Use --force to continue.

Aborted due to warnings.

我不确定导致此错误的原因。 我到处都看过,但找不到解决方案。 这是CSS链接-

 <!-- build:css(.) styles/vendor.css -->
    <!-- bower:css -->
    <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css" />
    <link rel="stylesheet" href="bower_components/animate.css/animate.css" />
    <!-- endbower -->
    <!-- endbuild -->
    <!-- build:css(.tmp) styles/main.css -->
    <link rel="stylesheet" href="styles/main.css">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
    <link href="https://fonts.googleapis.com/css?family=Bungee|Carrois+Gothic+SC|Oswald" rel="stylesheet">
    <base href="/">
    <!-- endbuild -->

我发现了错误,我只需要更改链接标签的位置。 它应该是 -

<!-- build:css(.) styles/vendor.css -->
    <!-- bower:css -->
    <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css" />
    <link rel="stylesheet" href="bower_components/animate.css/animate.css" />
    <!-- endbower -->
    <!-- endbuild -->
    <!-- build:css(.tmp) styles/main.css -->
    <link rel="stylesheet" href="styles/main.css">
    <!-- endbuild --> 
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
    <link href="https://fonts.googleapis.com/css?family=Bungee|Carrois+Gothic+SC|Oswald" rel="stylesheet">
    <base href="/">

现在grunt build运行良好。 所以只有main.css文件必须放在<!-- build:css(.tmp) styles/main.css --><!-- endbuild -->

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM