Questions tagged [system.web.optimization]

The System.Web.Optimization namespace includes classes that support Content Delivery Networks (CDN) and the process of optimizing JavaScript and cascading style sheet (CSS) files in a website to reduce file size and improve page performance. The classes in this namespace enable developers to carry out bundling and minification tasks to optimize their JavaScript and CSS files.

81 questions
28
votes
2 answers

IItemTransform and existing minified files

TL;DR: IItemTransform isn't getting executed when a minified file already exists in the same folder as the original (non-minified) file. Problem explanation I'm having this issue mainly because of CSS relative image references. If you used…
15
votes
1 answer

Can you pre-cache ASP.NET Bundles?

Every time I deploy an MVC web application my server has to re-cache all js and css bundles. Because of this it can take several seconds for the first view to render after deploying. Is there a way to pre-cache bundles? After all, the files are…
Mark Rucker
  • 6,952
  • 4
  • 39
  • 65
11
votes
2 answers

How do I get System.Web.Optimization bundles to work with custom folders in an IIS virtual directory?

I have an asp.net mvc4. I have modules that are deployed as subdirectories within this application using IIS Virtual Directories and I need to reference files in these modules. These module dlls are registering bundles. But the bundles are not…
10
votes
1 answer

Bundling and minification of ES6 javascript files in an asp.net MVC web application

We know that System.Web.optimization does not support ES6 javascript files bundling and minification, So how to support that?
9
votes
4 answers

How do I add type="text/javascript" to a script tag when using System.Web.Optimization

I have the following bundles.Add(new ScriptBundle("~/bundles/scripts/common").Include( "~/Scripts/jquery.validationEngine.js", "~/Scripts/common.js")); Which generates
9
votes
4 answers

Skip single file from Minifying?

I'm trying to use ASP.Nets BundleTable to optomize some javascript files, but have run into a problem where a specific addon (jQuery-Timepicker) fails to work when the code has been minified. See here. Bundle code is currently similar to: // Add our…
7
votes
5 answers

Getting System.Web.Optimization to work in a razor view within a class library

I'm building a modular MVC4 app, where each module (=area) is a class library. Models and controllers compile into the .dll, the views get copied into the appropriate folder. At runtime, everything works fine. At design time there is one annoying…
6
votes
1 answer

How do you Cache-bust individually rendered files while debugging?

Currently it is impossible for devs to easily work together. While debugging our code minification and bundling are turned off and so is the cache buster. This leads to every dev that touches javascript having to open every javascript file and…
Marie
  • 2,114
  • 1
  • 17
  • 31
6
votes
2 answers

Customize cache-busting in system.web.optimization

When rendering the styles from bundles when optimization is on you get this: Unfortunately the Android browser do not seem to…
Spoike
  • 119,724
  • 44
  • 140
  • 158
5
votes
0 answers

System.Web.Optimization minifying arrow function issue

I have js files which I am using arrow function like the following: $(document).ready(() => {}); And I am using System.Web.Optimization for bundling and minification in an MVC web application. When I run my application it shows me the following…
5
votes
1 answer

asp.net Webforms Bundling & minification - Bundled script throws 404

I have been trying to implement bundling and minification for my existing asp.net webforms project and unfortunately it is ending up with 404 responses. Let me first share the steps I have followed. Installed System.Web.Optimization through nuget.…
5
votes
2 answers

Why isn't my css getting minified?

I'm not clear what I'm missing here. As far as I can tell I've followed the instruction here. But my css bundle is still not getting minified. Here's my RegisterBundles code: public static void RegisterBundles(BundleCollection bundles) { …
Liam
  • 27,717
  • 28
  • 128
  • 190
5
votes
2 answers

How to reference version 1.1.0.0 of System.Web.Optimization assembly

I am currently trying to use a file upload called the Jquery-File-Upload by BlueImp in my MVC 4 application via nugget. This file upload depends on System.Web.Optimization namespace to work. My application keeps throwing this error: Error 9 …
Shittu Joseph Olugbenga
  • 6,396
  • 5
  • 26
  • 37
5
votes
2 answers

JavaScript Error in Asp.Net MVC 4 Bundling

When I use the below Bundling in MVC 4, my App gets several JavaScript errors,such as 'jQuery undefined' bundles.Add(new ScriptBundle("~/bundles/jquery").Include( "~/Scripts/jquery-{version}.js", …
4
votes
2 answers

ASP.NET MVC: StyleBundle IncludeDirectory & CssRewriteUrlTransform

I have the same problem as many that my images are not resolved when I bundle my CSS-Stylesheets. Now I found some SO-Answers that suggest using new CssRewriteUrlTransform() as second parameter for the "Include"-Method of a new StyleBundle-Object.…
1
2 3 4 5 6