Today in the use of MVC4 packaging compression function @scripts.render ("~/bundles/jquery") when some confusion, asked what in the App_start folder under BundleConfig.cs file
Bundles. ADD (New Scriptbundle ("~/bundles/jquery"). Include (
"~/scripts/jquery-{version}.js",
"~/scripts/jquery.unobtrusive-ajax.js"
));
It's okay to write, but
Bundles. ADD (New Scriptbundle ("~/bundles/jquery"). Include (
"~/scripts/jquery-{version}.js",
"~/scripts/jquery.unobtrusive-ajax.min.js"
));
It's not possible to write it, but I have it in my catalogue.
"~/scripts/jquery.unobtrusive-ajax.min.js"
This file.
By debugging the trace found that the ". Min.js" file has been filtered within MVC
By decompile This DLL file
You can see the following decompile code:
public static void Adddefaultignorepatterns (Ignorelist ignorelist)
{
if (ignorelist = = null)
{
throw New ArgumentNullException ("Ignorelist");
}
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);
}
This allows us to know that MVC defaults to filtering out the files for suffix. intellisense.js,-vsdoc.js,. debug.js,. Min.js,. Min.css, which is why we're referencing the. min.js file does not work.
The above mentioned is the entire content of this article, I hope you can enjoy.