Question


I was tasked with start using ASP.NET Bundling instead of RequestReduce. It seemed as an easy task at first, but then i ran into problems, when minifieng CSS files:

(3017,287): run-time error CSS1054: JavaScript error in expression property: Variable 'jGrowl' has not been declared: jGrowl 
(3017,287): run-time error CSS1054: JavaScript error in expression property: Variable 'ignoreMe2' has not been declared: ignoreMe2 
(3018,151): run-time error CSS1054: JavaScript error in expression property: Variable 'ignoreMe' has not been declared: ignoreMe
(3022,156): run-time error CSS1054: JavaScript error in expression property: Variable 'ignoreMe2' has not been declared: ignoreMe2 

I found it was the jGrowl which was screwing with me. After some googleing i found: http://kenhaines.net/post/2012/06/09/WebGrease-As-seen-in-Visual-Studio-2012.aspx

There i found:

Your file appears to have undeclared JS globals in it, so the errors are expected. You should add them to the GlobalsToIgnore setting in the webgrease manifest file.

ex:

<GlobalsToIgnore>jGrowl;ignoreMe;ignoreMe2</GlobalsToIgnore>

Where is the webgrease manifest file? And how do i edit it?

Ive been googleing alot without any luck

Btw. My first question in here, so feedback on my question setup would be nice aswell :)

// Peace out

Was it helpful?

Solution

WebGrease supports two modes: runtime and buildtime.

Runtime mode is used by ASP.NET during bundling and minifying. In this mode, WebGrease DLLs are called during the run time of the web site.

Buildtime mode (or command line mode) is used when WG.EXE is called from command line or from build process.

WebGrease manifests is the feature that is only available for build time or for running WG.EXE from command line. These manifest files provide the way for user to add the additional configuration parameters for WebGrease (such as "GlobalsToIgnore").

Unfortunately, WG manifests are not available for runtime. So, if you are minifying from ASP.NET, you will not be able to use them.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top