Gruntjs grunt:cdnify不';我什么也不做

Gruntjs grunt:cdnify不';我什么也不做,gruntjs,yeoman-generator,Gruntjs,Yeoman Generator,我使用Yeoman创建了一个AngularJS应用程序。它还使用cdnify任务,该任务应将bower_components/angular/angular.js转换为//ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js。生成的index.html包含以下代码: <!-- build:js scripts/vendor.js --> <!-- bower:js --> <script src=

我使用Yeoman创建了一个AngularJS应用程序。它还使用cdnify任务,该任务应将bower_components/angular/angular.js转换为//ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js。生成的index.html包含以下代码:

<!-- build:js scripts/vendor.js -->
<!-- bower:js -->
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap.js"></script>
<!-- endbower -->
<!-- endbuild -->
我的bower.json如下所示:

{
  "name": "myAmazingAngularApp",
  "version": "0.0.0",
  "dependencies": {
    "jquery": "~1.11.0",
    "angular": "1.2.x",
    "bootstrap": "~3.1.1",
    "angular-bootstrap": "~0.10.0"
  }
}
有人知道我做错了什么吗?我认为它应该是开箱即用的,所以我怀疑它是一个bug

还有一个.bowerrc文件包含以下内容:

{
    "directory": "app/bower_components"
}

当运行
grunt cdnify
时,我尝试将此设置更改为
“目录”
bower\u组件”
,但没有帮助。

您能检查.bowerrc或bower.json中
目录“
的配置吗?应该是
“bower\u组件”
在你的情况下。我已经检查了
目录
,它列在我的
.bowerrc
中。My
bower.json
不包含目录项。我没有修改此数据。在.bowerrc中,您的目录配置与此完全相同:
“目录”:“bower\u组件”
?您还可以在Gruntfile.js中向我们展示您对cdnify任务的配置吗?默认的Yeoman生成器会生成一个
.bowerrc
,其中包含
“目录”=“应用程序/bower\u组件”
index.html
文件中的实际
href
包含
。为了安装Bower组件,我使用了生成的设置,但在运行
grunt cdnify
时,我还试图更改.bowerrc,因此它只包含
“directory”=“Bower\u components”
。不幸的是。。。这没用。。。但是由Yeoman的Angular generator生成的文件似乎无论如何都是错误的。您的包配置中有哪个版本的
grunt google cdn
?尝试更新到~0.4.0。请记住,默认yeoman配置中的cdnify会从dist目录更新html文件。
{
  "name": "myAmazingAngularApp",
  "version": "0.0.0",
  "dependencies": {
    "jquery": "~1.11.0",
    "angular": "1.2.x",
    "bootstrap": "~3.1.1",
    "angular-bootstrap": "~0.10.0"
  }
}
{
    "directory": "app/bower_components"
}