How do I exclude a .js file in my asp.net web optimizations?

300 Views Asked by At

I am using bundling included in the asp.net web optimizations, and there is a single .js file that is located in my directory that I want to ignore.

Right now I'm doing:

bundles.Add(new ScriptBundle("~/bundles/content")
    .IncludeDirectory("~/Content/src", "*.js", true));

I would like to exclude app.js from this. How can I tell the IncludeDirectory to ignore this file?

1

There are 1 best solutions below

0
Scottie On

I found the solution...

bundles.IgnoreList.Ignore("app.js");

You can also use this with wildcards.

https://msdn.microsoft.com/en-us/library/system.web.optimization.bundlecollection.ignorelist%28v=vs.110%29.aspx