在 BundleConfig.cs 中我想进行以下操作:
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
请使用缩小版本。我尝试过:
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.min.js"));
但是 jquery 文件不再包含在我的网站中。我自行托管缩小版本,它存在于服务器上。
最佳答案
由于 BundleCollection.IgnoreList,在 Debug模式下脚本的最小版本将被忽略。如果需要,可以对其进行修改以清除 -min.js 和其他文件。
Advanced options of Bundling and minfication
虽然在 web.config 中打开调试的建议可行,但您的应用程序完全失去了调试能力。
关于jquery - MVC4 缩小版 jQuery 包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18019904/