簡體   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