2

I upgraded my MVC4 to MVC5, now all my files, that were ending with .min or .debug are not included in bundle. In MVC4, bundles.IgnoreList.Clear(); helped, but not anymore.

    public static void RegisterBundles(BundleCollection bundles) {

        bundles.IgnoreList.Clear();     

        bundles.Add(new ScriptBundle("~/bundles/library")
            .IncludeDirectory("~/Scripts/Libraries", "*.js", true));
    }

How to make it not to ignore my .min and .debug files in MVC5?

Jaanus
  • 16,161
  • 49
  • 147
  • 202

2 Answers2

3

Seems there is no way to include file.min.js to the bundle. But file-min.js, file-debug.js and file.debug.js still work.

See this demo project

Note: Project uses packages:

Microsoft ASP.NET Web Optimization Framework 1.1.3

Microsoft ASP.NET MVC 5.2.2

Max Brodin
  • 3,903
  • 1
  • 14
  • 23
0

I assumed my problem was the ignore list when my script bundle stopped showing up when EnableOptimizations was on, and spent an hour trying to fix my minified filenames and such. However, my problem turned out to be the bundle names I was using, which contained a '.' in them.

For example, changing

new ScriptBundle("~/bundles/root1.0ThirdParty")

to

new ScriptBundle("~/bundles/root10ThirdParty")

fixed the issue for me, and everything worked even with minified files in the includes.

TonyE
  • 113
  • 1
  • 8