Jon*_*onH 5 javascript asp.net minify signalr
我在我的应用程序中使用signalr并且正如此引用它:
<script src="/signalr/hubs" type="text/javascript"></script>
当然signalr是动态生成的javascript动态.当我运行yslow来改善我的Web应用程序的性能时,它抱怨singalr/hubs没有缩小.当我点击链接时,它显示了js,小片段样本:
/*!
* ASP.NET SignalR JavaScript Library v2.1.1
* http://signalr.net/
*
* Copyright Microsoft Open Technologies, Inc. All rights reserved.
* Licensed under the Apache 2.0
* https://github.com/SignalR/SignalR/blob/master/LICENSE.md
*
*/
/// <reference path="..\..\SignalR.Client.JS\Scripts\jquery-1.6.4.js" />
/// <reference path="jquery.signalR.js" />
(function ($, window, undefined) {
/// <param name="$" type="jQuery" />
"use strict";
if (typeof ($.signalR) !== "function") {
throw new Error("SignalR: SignalR is not loaded. Please ensure jquery.signalR-x.js is referenced before ~/signalr/js.");
}
var signalR = $.signalR;
function makeProxyCallback(hub, callback) {
return function () {
// Call the client hub method
callback.apply(hub, $.makeArray(arguments));
};
}
function registerHubProxies(instance, shouldSubscribe) {
var key, hub, memberKey, memberValue, subscriptionMethod;
Run Code Online (Sandbox Code Playgroud)
如果自动生成此文件,我该如何缩小它?
也让我澄清我使用lcsk它可以发现在这里,它使用signalr.在这个包中有一个startup.cs文件,如下所示:
using Microsoft.Owin;
using Owin;
[assembly: OwinStartup(typeof(RIMS.LCSK.Startup))]
namespace RIMS.LCSK
{
public class Startup
{
public void Configuration(IAppBuilder app)
{
app.MapSignalR();
}
}
}
Run Code Online (Sandbox Code Playgroud)
我是否需要以某种方式告诉它在这一点上缩小?我见过这个:
SignalR hub.js缩小(但这似乎是使用global.asax文件)而且我也看到了这个:
https://github.com/SignalR/SignalR/issues/2403
但我不确定我需要用我所拥有的东西做什么.
| 归档时间: |
|
| 查看次数: |
943 次 |
| 最近记录: |