Visual Studio and Knockout.js - Combining, Minimizing, and Conventioning

I use binding and minimization using ASP.NET MVC4 and Visual Studio.

The agreement states that:

  • Selecting the ".min" file for release when "FileX.min.js" and "FileX.js" exist.
  • Selecting the ".min" version for debugging.
  • Ignoring -vsdoc files (such as jquery-1.6.2-vsdoc.js) that are used only by IntelliSense.

The problem is that the debug.js extension is completely ignored, and when I use knockout and knockout through NuGet, they come with these extensions. So, do I always get a mini version, even if in debug mode?

I could rename the files from .debug.js to .min.js to get the non-minified version in debug mode, but could it break the update function via nuget?

Is there a solution for .debug.js files?

+5
source share
1 answer

Here are all the current default list ignore rules with RTM 1.0:

        ignoreList.Ignore("*.intellisense.js");
        ignoreList.Ignore("*-vsdoc.js");
        ignoreList.Ignore("*.debug.js", OptimizationMode.WhenEnabled);
        ignoreList.Ignore("*.min.js", OptimizationMode.WhenDisabled);
        ignoreList.Ignore("*.min.css", OptimizationMode.WhenDisabled);

Thus, debug.js will be ignored when debug = false. Renaming or clearing the ignore list are two easy workarounds.

+3
source

All Articles