Grunt构build打破了我编译的JavaScript

我有一个从一开始就不是我的项目,整个部署是不完整的。 我有惊吓忽略覆盖指定在这里 ,现在我发现,当他生成vendor.js与所有的依赖关系,它根本无法工作。 浏览器打印:

Uncaught TypeError: Cannot read property 'Item' of undefined(anonymous function) @ vendor.js:14(anonymous function) @ vendor.js:14 vendor.js:4 Uncaught Error: [$injector:nomod] Module 'gettext' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. http://errors.angularjs.org/1.2.14/$injector/nomod?p0=gettext(anonymous function) @ vendor.js:4(anonymous function) @ vendor.js:4b @ vendor.js:4l.bootstrap @ vendor.js:4(anonymous function) @ scripts.js:1 VM47 vendor.js:4 Uncaught Error: [$injector:modulerr] Failed to instantiate module trepeatApp due to: Error: [$injector:modulerr] Failed to instantiate module angularPayments due to: Error: [$injector:nomod] Module 'angularPayments' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. 

当我只使用咕噜服务任务,它工作正常,但如果我咕build在这些任务波妞build立一些东西只是打破了怪胎脚本

  'concat', 'ngmin', 'copy:dist', 'cdnify', 'cssmin', 'uglify', 'usemin', 'htmlmin', 

有人能帮我吗? 我越来越绝望了

[更新 – 2015年8月24日]我已阅读@RobSchmuecker评论的链接,并改变了一些gettextconfiguration的东西,其中一个错误已解决。

 Uncaught Error: [$injector:modulerr] Failed to instantiate module trepeatApp due to: Error: [$injector:modulerr] Failed to instantiate module angularPayments due to: Error: [$injector:nomod] Module 'angularPayments' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. http://errors.angularjs.org/1.4.4/$injector/nomod?p0=angularPayments at http://mylocaldev.com:3000/scripts/vendor.js:4:15152 at http://mylocaldev.com:3000/scripts/vendor.js:4:24650 at b (http://mylocaldev.com:3000/scripts/vendor.js:4:24123) at http://mylocaldev.com:3000/scripts/vendor.js:4:24435 at http://mylocaldev.com:3000/scripts/vendor.js:5:1222 at f (http://mylocaldev.com:3000/scripts/vendor.js:4:15559) at n (http://mylocaldev.com:3000/scripts/vendor.js:5:1000) at http://mylocaldev.com:3000/scripts/vendor.js:5:1169 at f (http://mylocaldev.com:3000/scripts/vendor.js:4:15559) at n (http://mylocaldev.com:3000/scripts/vendor.js:5:1000) http://errors.angularjs.org/1.4.4/$injector/modulerr?p0=angularPayments&p1=…20n%20(http%3A%2F%2Fmylocaldev.com%3A3000%2Fscripts%2Fvendor.js%3A5%3A1000) at http://mylocaldev.com:3000/scripts/vendor.js:4:15152 at http://mylocaldev.com:3000/scripts/vendor.js:5:1428 at f (http://mylocaldev.com:3000/scripts/vendor.js:4:15559) at n (http://mylocaldev.com:3000/scripts/vendor.js:5:1000) at http://mylocaldev.com:3000/scripts/vendor.js:5:1169 at f (http://mylocaldev.com:3000/scripts/vendor.js:4:15559) at n (http://mylocaldev.com:3000/scripts/vendor.js:5:1000) at $a (http://mylocaldev.com:3000/scripts/vendor.js:5:2690) at h (http://mylocaldev.com:3000/scripts/vendor.js:4:22195) at ga (http://mylocaldev.com:3000/scripts/vendor.js:4:22505) http://errors.angularjs.org/1.4.4/$injector/modulerr?p0=trepeatApp&p1=Error…ga%20(http%3A%2F%2Fmylocaldev.com%3A3000%2Fscripts%2Fvendor.js%3A4%3A22505) 

发现,当我跑grunt serve一切都会正常工作,但是当我编译,缩小和一切这个错误

Uncaught TypeError: Cannot read property 'Item' of undefined(anonymous function) @ vendor.js:14(anonymous function) @ vendor.js:14

实际上会阻止angular度的正确运作。 这个问题是由于在bower.json文件中需要重写bower.json所以item.jsitem.js之前被加载,而且由于某些未知的原因,override选项不适用于我。 我必须从我的bower.json删除outlayer ,并将所有内容加载到angular度后手动将其包含在索引中。

正如jesus.jackson.sena正确指出的,这个错误可能是由Outlayer造成的。 但与他形成鲜明对比的是,替代对我来说效果不错。 所以作为需要它的人的参考,就是如何在bower.json正确设置覆盖:

 "overrides": { "outlayer": { "main": [ "item.js", "outlayer.js" ] } } 

对于那些对此行为感兴趣的人: outlayer.js有以下初始化代码:

 window.Outlayer = factory( window, window.EvEmitter, window.getSize, window.fizzyUIUtils, window.Outlayer.Item ); 

对于要定义的window.Outlayer.Item,必须首先调用Outlayer的item.js,它将其定义如下:

 window.Outlayer = {}; window.Outlayer.Item = factory( window.EvEmitter, window.getSize );