我将尝试使用ASP.Net的BundleTable来优化一些Javascript文件,但是遇到了一个问题,当代码被压缩时,特定的插件(jQuery-Timepicker)无法正常工作。请参见这里。目前bundle代码类似于:
如果我移除
我想知道是否有办法设置我的打包代码来跳过压缩这个文件(但仍将其包含在捆绑文件中)?我一直在寻找解决方案,但没有找到任何解决方案。
// Add our commonBundle
var commonBundle= new Bundle("~/CommonJS" + culture.ToString());
// JQuery and related entries.
commonBundle.Include("~/Scripts/jquery-1.7.2.js");
commonBundle.Include("~/Scripts/jquery-ui-1.8.22.js");
commonBundle.Include("~/Scripts/jquery.cookie.js");
commonBundle.Include("~/Scripts/jquery-ui/jquery-ui-timepicker-addon.js"); // This is the one that does not work when bundled
// JS Transformer
commonBundle.Transforms.Add(new JsMinify());
BundleTable.Bundles.Add(commonBundle);
如果我移除
jquery-ui-timepicker-addon.js
文件,然后在我的网页中单独包含它,那么它就可以正常工作。(否则我会收到Uncaught TypeError: undefined is not a function
错误)。我想知道是否有办法设置我的打包代码来跳过压缩这个文件(但仍将其包含在捆绑文件中)?我一直在寻找解决方案,但没有找到任何解决方案。
commonBundle.Include
行移动到转换之后的时间选择器后面? - Toby