web-optimization

CssRewriteUrlTransform does not take

℡╲_俬逩灬. 提交于 2020-05-11 07:45:49
问题 bundles.Add(new StyleBundle("~/a/b/c") .Include("~/Content/font-awesome.css", new CssRewriteUrlTransform())); I have this bundling. The font-awesome css has a url defined as url('../fonts/fontawesome-webfont.eot?v=4.0.3') which is valid when the css is located under "~/Content/font-awesome.css" but now its located under "~/a/b" But CssRewriteUrlTransform does not kick in and rewrite path to url('../../fonts/fontawesome-webfont.eot?v=4.0.3') Update: If I remove the .min file it

Is there a way to update asp.net mvc bundle contents dynamically at run-time?

南楼画角 提交于 2020-01-13 08:42:30
问题 I'm ASP.NET MVC v4 for my application, and I'm using the web optimization features (bundling and minification of scripts and styles). Now, what I understand is (please correct me if wrong), the optimization framework will look at the included files at the time of compilation and configure them. It'll create a version number (v=something) based on the contents. Every time the contents change, it'll recreate the version hash, and the client will get updated files. Now, is there a way to get the

<webopt:BundleReference> renders ScriptBundle as css link elements

为君一笑 提交于 2020-01-02 04:37:27
问题 I'm trying to use the new .net 4.5 webforms control to render bundles in my materpage. I have a scriptbundle defined in my BundleConfig.cs like this: bundles.Add(new ScriptBundle("~/bundles/app").Include( "~/Scripts/underscore.js", "~/Scripts/backbone.js", "~/Scripts/app/app.js", "~/Scripts/app.validator.js", "~/Scripts/app/views/home.js", "~/Scripts/app/views/about.js", "~/Scripts/app/views/contact.js", "~/Scripts/app/controls/hello.js", "~/Scripts/app/init.js")); I then try to render the

MVC Bundling - Include .min file for a single bundle

試著忘記壹切 提交于 2019-12-30 05:20:06
问题 I have a single file in my application that I only have a minified version of and I would like to create a bundle for it: bundles.Add(new ScriptBundle("~/bundles/maskedinput").Include( "~/Scripts/jquery.maskedinput-1.3.min.js")); The problem is that by default in debug mode, the bundling mechanism ignores .min files. I don't want to turn off this rule for all bundles, but I would like to disable it for this single bundle. Is this possible? 回答1: A quick fix is to rename the js file taking out

Google Web Optimizer — How long until winning combination?

房东的猫 提交于 2019-12-22 18:36:32
问题 I've had an A/B Test running in Google Web Optimizer for six weeks now, and there's still no end in sight. Google is still saying: "We have not gathered enough data yet to show any significant results. When we collect more data we should be able to show you a winning combination." Is there any way of telling how close Google is to making up its mind? (Does anyone know what algorithm does it use to decide if there's been any "high confidence winners"?) According to the Google help

ASP.NET Bundles in regular html?

拈花ヽ惹草 提交于 2019-12-20 03:16:37
问题 My angular application is backed by ASP.NET webapi, where I'm serving up an index.html and angular handles everything else from there. I'd like to use bundling, but I can't see how I'd do this. Do I have to use razor (or webforms) just to reference bundles? Or is there an option to give the bundle output a fixed name that I can reference in my src/hrefs? To clarify, I'm not using MVC or Webforms to serve html. You just get redirected to index.html , and the routing is all client-side. My

CssRewriteUrlTransform with or without virtual directory

旧城冷巷雨未停 提交于 2019-12-17 06:28:22
问题 We are using MVC Bundling in our site, CssRewriteUrlTransform makes sure that the image urls work from the dynamic bundle css file. But this only works when not using a virtual directory, i.e http://localhost/VirttualDir does not work but http://localhost/ does. This is because the CssRewriteUrlTransform tranform does not take the virtual folder into account when rewriting the url. So if a image real path is localhost/vdir/content/img/foo.png it will rewrite it to localhost/content/img/foo

Why does the CdnFallbackExpression generate a version-less bundle?

我是研究僧i 提交于 2019-12-12 12:12:29
问题 Typically, all bundles generated by System.Web.Optimization are given versions in their query parameters. However, if you specify a CdnPath and CdnFallbackExpression value, the src attribute in the fallback <script> is left without a version. Is there a reason for this I'm not understanding, or is this a bug in the code? 来源: https://stackoverflow.com/questions/21298412/why-does-the-cdnfallbackexpression-generate-a-version-less-bundle

JavaScript being loaded asynchronously in Firefox 3 (according to Firebug)?

对着背影说爱祢 提交于 2019-12-10 20:47:36
问题 I'm trying to profile the performance of a web site that I'm fairly confident is being slowed down by the loading of JavaScript files on the page. The same JavaScript files are included several times on the page, and <script /> tags are scattered throughout the page instead of being included at the bottom. As I suspected, when looking at FireBug's "Net" tab, most of the time (not all) when JavaScript is being loaded, no other files are requested. The browser waits for the JavaScript to

Using bundles in WebForms outputs the minified/combined file even in debug mode

前提是你 提交于 2019-12-10 13:33:05
问题 I've created a bundle of various script files that I want to be combined/minified together. In my code behind file (yes, sorry it's in VB!) I add it to a <asp:placeholder /> on the <head> like this Me.PlhHeader.Controls.Add(New LiteralControl(Scripts.Render("~/bundles/main").ToHtmlString())) This will work, but it always seems to output the compressed minified version, even when debug="true" in the Web.Config. no matter what, this is what is output: <script src="/bundles/main"></script> What