javascript - minify the signalr/hubs file -
i'm using signalr in app , referencing so:
<script src="/signalr/hubs" type="text/javascript"></script>
of course signalr generated javascript dynamically on fly. when run yslow better performance of web application complains singalr/hubs not minified. surely when click on link shows js, small snippet sample:
/*! * asp.net signalr javascript library v2.1.1 * http://signalr.net/ * * copyright microsoft open technologies, inc. rights reserved. * licensed under 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 not loaded. please ensure jquery.signalr-x.js referenced before ~/signalr/js."); } var signalr = $.signalr; function makeproxycallback(hub, callback) { return function () { // call client hub method callback.apply(hub, $.makearray(arguments)); }; } function registerhubproxies(instance, shouldsubscribe) { var key, hub, memberkey, membervalue, subscriptionmethod;
how can minify file if generated automagically?
edit
let me clarify using lcsk
can found here, uses signalr. in package there startup.cs file looks this:
using microsoft.owin; using owin; [assembly: owinstartup(typeof(rims.lcsk.startup))] namespace rims.lcsk { public class startup { public void configuration(iappbuilder app) { app.mapsignalr(); } } }
do need somehow tell minify @ point? i've seen this:
signalr hub.js minify (but seems using global.asax file) , i've seen this:
https://github.com/signalr/signalr/issues/2403
but i'm uncertain need of have.
check out extensibility guide. lists ijavascriptminifier
interface can implement you're looking for. (and maybe couple optimization/bundling library or 3rd party minifier).
Comments
Post a Comment