Question

I'm trying to use Microsoft's Web Optimization bundling toolkit, which works well for everything else.

When I try to ask it to minify AngularJS, though, I get this error message in the resultant Javascript output:

"Ambiguous reference to named function expression"

I'm not even sure where to start with this one . . .

Était-ce utile?

La solution

The answer to this question (which should not have been downvoted, in my opinion, because it represents a real issue) is to upgrade from the older Microsoft.Web.Optimization package that uses the "Microsoft.Web.Optimization" namespace and making sure you're using their latest, signified by the "System.Web.Optimization" namespace instead.

In the older Microsoft package, Angular would bomb out when handed to JsMinify. Not so anymore in the latest version.

I hadn't realized at first that I was on an older version of that package because the package name changed - hence my spinning my wheels on it for a while.

Autres conseils

The best workaround in my opinion is to preminify the Angular applications using ngmin before minifying with another tool in order to keep dependency injection working.

https://github.com/btford/ngmin

HTH

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top