Closed dudkiewicz-codes closed 9 years ago
Perhaps related, but my angular app does not run after lineman build
but does fine under lineman run
. I'm only guessing this is because of ngmin
as I keep getting Uncaught object
errors after a build. Unfortunately Chrome isn't very nice at showing error messages, but Safari show's me this:
[Error] Error: [$injector:unpr] Unknown provider: aProvider <- a <- $http <- $templateFactory <- $view <- $state
http://errors.angularjs.org/1.2.19/$injector/unpr?p0=aProvider%20%3C-%20a%20%3C-%20%24http%20%3C-%20%24templateFactory%20%3C-%20%24view%20%3C-%20%24state
(anonymous function) (app.js, line 2)
c (app.js, line 2)
... lots more ...
So I'm guessing thats because ngmin
doesn't really support ui-router
, and if you're building any decent Angular app these days you're probably using ui-router
;-)
@mattupstate you can possibly make the lineman build work by disabling mangle in uglify. Something like this in config/application.js
uglify: {
options: {
mangle: false
}
}
@maxxkrakoa that helped, thanks for the tip.
ngmin doesn't support router's resolve functions and I agree we should move to ng-annotate. I need to research more on that...
@maxxkrakoa @mattupstate Thanks for the tip. I added the mangle:false
option to my project and it solved my Unknown provider
issue. Is there going to be a solution allowing us to turn mangle on and still generate distrubtion files? (I am using ng-annotate btw)
This should be resolved (a while back) by #11. Care to close, @pdudkiewicz, if you agree?
Agreed
Plugin should migrate from buggy and not maintained ngmin to ng-annotate. See https://github.com/btford/ngmin/issues/93 and this comment: https://github.com/btford/ngmin/issues/93#issuecomment-43699038