asp.net - 如何有效地在 bundle 中添加 .min 和 .debug 文件

标签 asp.net asp.net-mvc asp.net-mvc-4 asp.net-optimization

我想利用 .min.debug 版本的 jscss 文件。

例如考虑这个包:

 bundles.Add(
          new ScriptBundle("~/scripts/vendor")
            .Include("~/scripts/jquery-{version}.js")
            .Include("~/scripts/knockout-{version}.debug.js")
            .Include("~/scripts/knockout-{version}.min.js")
            .Include("~/scripts/knockout-{version}.js")

利用每个文件的正确机制是什么。我的意思是如何设置一些设置以使 ASP.NET 足够智能以在最终版本上使用 .min 并在调试时使用 .debug

最佳答案

只需使用 .Include("~/scripts/knockout-{version}.js"),ASP.NET 将使用 ~/scripts/knockout-{version}.min。 js 在生产和 ~/scripts/knockout-{version}.js 在调试时

关于asp.net - 如何有效地在 bundle 中添加 .min 和 .debug 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18426259/

相关文章:

asp.net-mvc - 在MVC中生成没有 Controller 的 View ?

c# - HttpPost 和 webapi

javascript - 当屏幕中的某些内容发生更改时启用按钮

asp.net - 信任失败 : The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel

jquery - 在 fullcalendar 中添加新事件时如何获取资源 id

asp.net - 使用 HttpModule Asp.net 重定向 URL

c# - 编译器无法识别数据集(我使用向导或 .xsd 文件添加)

.net - 如何使用 ASP.NET 路由路由树结构的 URL?

asp.net-mvc - 如何在 View 中获取 session 值 asp.net core

c# - 何时使用主布局和局部 View MVC c#?