Questions tagged [bundling-and-minification]

Bundling and minification are used to optimize web content by reducing the number of requests to the server and as well as the size of requested assets (such as CSS and JavaScript).

Bundling makes it easy to combine or bundle multiple files into a single file. You can create CSS, JavaScript and other bundles. Fewer files means fewer HTTP requests and that can improve first page load performance.

Minification performs a variety of different code optimizations to scripts or CSS, such as removing unnecessary white space and comments and shortening variable names to one character.

References:

  1. Bundling and Minification
  2. Adding Bundling and Minification to ASP.NET Web Forms
  3. Adding Web Optimization to a Web Pages Site
  4. Performance Implications of Bundling and Minification on Web Browsing
1258 questions
0
votes
2 answers

YUI CSS Minification issues

I have 2 css files which are minified and combined into one file. But the CSS property on the same element is not combined. file1.css // this comes from a common library body { position: relative; margin: auto; } file2.css //this is a project…
Misam
  • 4,320
  • 2
  • 25
  • 43
0
votes
2 answers

Can I detect that javascript is being loaded unminified (as debug mode)

I would like to provide additional console logs when I'm running my app in debug mode (unminified and unbundled scripts). Is there an easy way to detect this in a script? I was thinking of having a function with a long parameter name and then get a…
Robert Koritnik
  • 103,639
  • 52
  • 277
  • 404
0
votes
1 answer

Bundling and Minification, when bundled one of my script dies at load time.. When not, it's perfectly fine

I'm have trouble with Bundleing and Minification.. Its a set up, if I have M&B on, it gets minified and added, I have ordering working correctly.. when M&B is off, eveything works fine. when M&B is on, everything is minified and loooks like it's…
Eric Brown - Cal
  • 14,135
  • 12
  • 58
  • 97
0
votes
0 answers

temporarily Stop Bundling and minification

I am using bundle.config in asp.net mvc but on my local machine every thing was working fine js and css but when i deployed on another machine js and css give me issues, js is not working properly and some css styles are not implemented. so i want…
0
votes
0 answers

ASP.NET Bundling and Minification removing license comments?

Is there any way to stop asp.net from removing important comments (license, /*! content */) when Bundling and Minifying javascript files with Microsoft.AspNet.Web.Optimization? im not 100% sure but removing it from the result would be illegal?
Peter
  • 37,042
  • 39
  • 142
  • 198
0
votes
0 answers

Bundles based on CDN not rendering script tag

I have bundles set up based on CDN: public static void RegisterBundles(BundleCollection bundles) { bundles.UseCdn = true; AddCss(bundles); AddJavaScript(bundles); } private static void AddJavaScript(BundleCollection…
Ethan Schofer
  • 1,718
  • 5
  • 26
  • 55
0
votes
1 answer

Problems with style of Jquery Datatable at publishing (possibly bundling issue)

I have been running into some bizarre issues when I try to publish my ASP.net MVC web app to my test servers IIS. I have decided that this might have something to do with the bundling. In my application I use a jquery datatable to display real-time…
0
votes
0 answers

Why are my js files being interpreted as stylesheets?

I want to use ASP.Net Bundling but I ran into this error with js files: Resource interpreted as Stylesheet but transferred with MIME type application/x-javascript: "http://localhost:54148/resources/js/jquery.js". Resource interpreted as Stylesheet…
Back UP
  • 148
  • 1
  • 6
0
votes
0 answers

Secure dynamic Javascript in CSHTML file

I am new to MVC platform and developing one business application in which I am using some JavaScript Excel Library. From Controller action, I pass my MODEL to view and then in View, I fill up my custom Excel Library by setting up business formulas &…
0
votes
2 answers

Bundled script files not showing up when doing versioning

I have a weird issue with the mvc4 bundler not including files with extension .min.js In my BundleConfig class, I declare public static void RegisterBundles(BundleCollection bundles) { bundles.Add(new ScriptBundle("~/Scripts/jquery") …
user3328402
  • 47
  • 2
  • 3
  • 12
0
votes
1 answer

CSS relative urls do not work when bundling in visual studio

In a css file i have this: .social-icons li .facebook { background: url(../img/social/facebook.png) no-repeat; } The img directory is indeed in "../" compared to the css file. Everything works ok if i include the css with normal markup in my…
e4rthdog
  • 5,103
  • 4
  • 40
  • 89
0
votes
0 answers

How to cosume Bundling and Minification in .NET on html page

I have an angular app with .NET backend. I am on stage where I need to deploy my app on production but before I do, I would like to use the bundling feature in .NET to minify my js,css files.To use bundling feature is not an issue but the problem is…
Ammar Khan
  • 2,565
  • 6
  • 35
  • 60
0
votes
1 answer

Creating and minifying JavaScript dynamically in ASP.NET MVC server-side code

I am using a ASP.NET route (to intercept the call to the .js) and controller to generate some JS I want to use on my client. The reason I'm doing this is so as to not have to duplicate id's or constants on the client. Here's the output of my…
0
votes
0 answers

How to include asp.net mvc "Sections" in bundles

I have in my page various sections of scripts because i like to keep my html and javascript in the same file.How can i include the "Section scripts in the bundle"?
Aflred
  • 4,435
  • 6
  • 30
  • 43
0
votes
0 answers

Varnish cluster and Last-Modified

In our setup we have 3 varnish servers in front of a cluster of backend servers. Varnish is load-balancing using round-robin. Resently we started using bundles for css and js. Each generated bundle gets a Last-Modified header from the backend…