Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does webopt:bundlereference work in ASP.Net?

In the default template of the ASP.Net web forms for Visual Studio 13, there is a tag webopt:

<webopt:bundlereference runat="server" path="~/Content/css" />

After searching, it seems it is for bundling and minification. Is there any official documentation for the tag? I am unable to find one. Specifically I wanted to know, how does it work? If there is already a minified file in the Content folder, it is taking that file. How can i change that behaviour? How does the path value translate, since there is no folder css inside Content folder?

like image 797
Abhay Kumar Avatar asked Oct 13 '14 06:10

Abhay Kumar


1 Answers

The webopt element is simply a webforms control for wrapping the bundling and minification from the Microsoft.AspNet.Web.Optimization namespace. It uses WebGrease to do the actual optimization feature.

I don't think there is a setting though that will let you ignore already minified content. Generally, if it's minified it will use that since it figures it doesn't need to spend the extra time repeating the job.

The source code is on codeplex as well as some documentation.

like image 118
Mark Fitzpatrick Avatar answered Oct 25 '22 20:10

Mark Fitzpatrick