Hi Can anyone give me an example on how to use Scriptbundle method IncludeDirectory for Javascripts, not able to get how to write the search pattern string , Is it regex?
bundles.Add(new ScriptBundle("~/bundles/customjs").IncludeDirectory( "~/Scripts/Custom",?);
Bundling and Minification are two performance improvement techniques that improves the request load time of the application. Most of the current major browsers limit the number of simultaneous connections per hostname to six. It means that at a time, all the additional requests will be queued by the browser.
You can create style or script bundles in BundleConfig class under App_Start folder in an ASP.NET MVC project. (you can create your own custom class instead of using BundleConfig class, but it is recommended to follow standard practice.)
To enable bundling and minification, set the debug value to "false". You can override the Web. config setting with the EnableOptimizations property on the BundleTable class. The following code enables bundling and minification and overrides any setting in the Web.
You can write like this:
bundles.Add(new ScriptBundle("~/bundles/customjs").IncludeDirectory( "~/Scripts/Custom","*.js"));
If you want for example javascript.
You can read more here: http://www.asp.net/mvc/tutorials/mvc-4/bundling-and-minification
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With