linemanjs / lineman-angular

A Lineman plugin for Angular projects (for a quickstart, see lineman-angular-template)
8 stars 5 forks source link

Migrate to ng-annotate #9

Closed dudkiewicz-codes closed 9 years ago

dudkiewicz-codes commented 10 years ago

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

mattupstate commented 10 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 ;-)

maxxkrakoa commented 10 years ago

@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
            }
        }
mattupstate commented 10 years ago

@maxxkrakoa that helped, thanks for the tip.

Foxandxss commented 10 years ago

ngmin doesn't support router's resolve functions and I agree we should move to ng-annotate. I need to research more on that...

trazek commented 9 years ago

@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)

ghost commented 9 years ago

This should be resolved (a while back) by #11. Care to close, @pdudkiewicz, if you agree?

dudkiewicz-codes commented 9 years ago

Agreed