当您添加脚本包并具有以下内容时:
bundles.Add(new ScriptBundle("~/bundles/base.scripts").Include( "~/Scripts/jquery-1*"));它加载原始Jquery版本和缩小版本。 这些文件都在Scripts文件夹中,因此我假设星号正在完成您所说的内容。
有没有办法在debug = false模式下只有缩小版本渲染,而在debug = true中的原始版本?
或者是实际指定您想要的文件而不是使用星号?
问候,雅克
When you add a script bundle and have something like:
bundles.Add(new ScriptBundle("~/bundles/base.scripts").Include( "~/Scripts/jquery-1*"));It loads up the raw Jquery version and the minified version. Those files are both in the Scripts folder so I assume the asterisk is doing exactly what you tell it.
Is there a way to have only the minified version render when in debug=false mode and the raw version in debug=true?
Or is it down to actually specifying the exactly files you want instead of using the asterisk?
Regards, Jacques
最满意答案
这应该通过BundleCollection的FileExtensionReplacementList自动发生,当调试= false时,应该选择文件的.min版本。 创建新项目时的默认模板也应该使用此功能。
This should be happening automatically via the BundleCollection's FileExtensionReplacementList which should be selecting the .min version of the file when debug=false. The default templates when you create a new project should be using this functionality as well.
更多推荐
发布评论