我使用 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/