angularjs - Grunt CDNify 不会对文件进行 CNDify

标签 angularjs build gruntjs cdn yeoman

我使用 Yeoman 并尝试使用 grunt 来构建和优化我的 dist。

我注意到在 cdnify:dist 之后我的 index.html 文件在相同之后仍然相同并且仍然引用本地凉亭。

<script src="bower_components/angular/angular.js"></script>

这个构建过程似乎通过了:

Running "cdnify:dist" (cdnify) task
Going through dist/404.html, dist/index.html to update script refs

使用 AngularJS 1.2.6,CDNify 0.2.2。

我的 bower.json 似乎符合 guidelines

我错过了什么吗?还有其他选择吗?

最佳答案

这是一个 reported issue与 CDNify。似乎 google-cdn 是硬编码支持的版本,而 Angular 1.2.x 目前不是。

Dan Smith (AKA X1011) ,通过使用 grunt-htmlrefs 解决了这个问题手动更新脚本标签。你可以看到他是怎么做到的in this commit他的边缘移动宾果游戏。

关于angularjs - Grunt CDNify 不会对文件进行 CNDify,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21661289/

相关文章:

javascript - AngularJS - 如何从 $compile 获取处理后的 HTML 输出?

javascript - AngularJS如何获取范围内变量的值

javascript - 使用 Angular 指令动态注入(inject)可运行的 JavaScript

javascript - 在 Grunt.js 中将 Processhtml 与 Jade 结合使用

gruntjs - ASP .NET 5 - 将文件从节点模块复制到 wwwroot 的 grunt 任务

javascript - 使用 ng-model 数组

c# - 为 x86 和 'Any CPU' 构建

amazon-web-services - 使用 Leiningen 通过 Gulp 构建前端

Android Gradle 如何为 Android Google API 4.2.2 而不是 Android 4.2.2 构建

linux - 在 Linux box 中使用 IE 启动器在 grunt 中运行 Karma