asp.net mvc Bundle.IncludeDirectory example?

Rameez Ahmed Sayad picture Rameez Ahmed Sayad · Mar 25, 2013 · Viewed 15.7k times · Source

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",?);

Answer

freshbm picture freshbm · Mar 25, 2013

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