stephenplusplus/grunt-wiredep

Order of javascript files

rickyngk opened this issue · 2 comments

I use onsenUI that has already used AngularJS and jqLite. Then need to add jquery, onsenUI asked me to add jquery AFTER AngularJS, but for grunt-wiredep, jquery always on top

The problem is likely due to the "elite dependencies" hidden behavior of wiredep. In the early Bower days, many packages were registering without properly listing their dependencies. So for the end user, it was safe to assume if jQuery was in their project's bower.json, it was going to need to be the first dependency when injected. Now that time has passed, we have more reliable packages in Bower. We're working on taptapship/wiredep#118 getting rid of this behavior.

Although, for your specific question, I'm not familiar with onsenUI, but would it hurt anything to let Angular use jQuery? If so, a solution for now would be using the excludes array in your project's configuration to list which combination of these you need to, then wiredep will stop injecting the references, and you can just manually write the ones that are being problematic.

yes, now I use excludes, and add jquey & angularjs manually in order.