【发布时间】:2013-06-06 23:26:52
【问题描述】:
我遇到了 mvc4 捆绑器不包含扩展名为 .min.js 的文件的问题。 在我的 Scripts 文件夹中,我有两个文件:bootstrap.js、bootstrap.min.js
在我的 BundleConfig 类中,我声明
#if !DEBUG
BundleTable.EnableOptimizations = true;
#endif
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include("~/Scripts/bootstrap.js"));
在 Debug 中运行时,它按预期呈现:
<script src="/Scripts/bootstrap.js"></script>
在 Release 中运行时,它呈现为:
<script src="/bundles/bootstrap?v=57XuMf8ytOYgVErEDhgFDRtQ5jlC48bryka4m2DVq_M1"></script>
为什么不渲染为:
<script src="/Scripts/bootstrap.min.js"></script>
【问题讨论】:
-
创建新问题时,StackOverflow 会建议可能提供答案的现有问题。请注意这些,如果您仍然找不到答案,请仅发布新问题。 Google 也是一个非常有用的工具,因为 StackOverflow 问题在 Google 中的排名非常。
标签: asp.net asp.net-mvc asp.net-mvc-4 bundling-and-minification