How does webopt:bundlereference work in ASP.Net?
Asked Answered
K

1

23

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?

Kirstinkirstyn answered 13/10, 2014 at 6:31 Comment(1)
See Bundling and Minification in ASP.NET Web Forms ApplicationHydrothermal
O
17

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.

Oxidation answered 14/10, 2014 at 3:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.