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
1 answer

In MVC 4, release mode is not generating .min version

I created a default internet (and tried intranet -- same problem) MVC 4 files in VS 2012 Ultimate Release 3, on Windows 7 64. I then set the release mode to Release instead of Debug, and ran the application. In IE 9, I right-clicked and selected…
0
votes
1 answer

MVC4 + AngularJS - prevent minification of properties

I've read this post Mvc4 bundling, minification and AngularJS services But it doesn't adress how to correctly minify AngularJS projects. Should I minify everything except my viewmodels ? Lets say my templates use code like this: Hello…
Roger Johansson
  • 22,764
  • 18
  • 97
  • 193
0
votes
1 answer

CSS bundling does not work in asp.net mvc4 app

I have the following in my BundleConfig.cs file bundles.Add(new StyleBundle("~/Content/css").Include( "~/Content/reset.css", "~/Content/site.css")); In my _Layout.cshtml file i set the styles like this @Styles.Render("~/Content/css") And when i…
Martin Overgaard
  • 355
  • 2
  • 7
  • 21
0
votes
0 answers

Bundling CSS and JS in MVC. Why can I just not get it to work?

I'm baffled. I have spent well over 8 hours on this. I have built the Bootstrap project, the default ASP.Net project, The default MVC 4 project. They bundle and work. I cannot get it into my live project (MVC 4). In the page source, it is pointing…
Miguelito
  • 302
  • 3
  • 11
0
votes
1 answer

Can't get bundling and minification to work on MVC4

I'm trying to bundle and minify my css and js files with a MVC4 application but can't get it to work. I installed the Microsoft.Web.Optimization package making use of the package manager console. I included the following statement in my HTML
Andre Lombaard
  • 6,985
  • 13
  • 55
  • 96
0
votes
0 answers

Use a cachebuster with asp.net mvc 4 bundling

I'm using the standard asp.net mvc bundler from the System.Web.Optimizations namespace. One of my css bundles contains some css files that have been changing frequently. bundles.Add(new StyleBundle("~/Styles/core").Include( "~/Styles/main.css", …
George Mauer
  • 117,483
  • 131
  • 382
  • 612
0
votes
2 answers

ASP.Net MVC Bundler not including my .min file in Release

I have an issue with the mvc4 bundler not including a file with extension .min.js. In my Scripts folder i have two files: bootstrap.js, bootstrap.min.js In my BundleConfig class, I declare #if !DEBUG BundleTable.EnableOptimizations =…
0
votes
1 answer

breezejs: error when minifying the script

I'm facing an issue when minifying breezejs : Error : Cannot get property « Validator » of a null reference (that's not the exact message but a translation of the original.) This is happening when I try to call breeze.Validator, meaning breeze…
Sam
  • 13,934
  • 26
  • 108
  • 194
0
votes
2 answers

I am trying to minifying javascript files using mvc4 bundle feature

I want to bundle all my JavaScript files so it should hit to server only once. But with this I am facing a problem. bundles.Add(new ScriptBundle("~/LayoutJs").Include( "~/Scripts/Libraries/jquery-1.8.2.min.js", …
0
votes
2 answers

CSS bundling issue

In my asp.net mvc application, I'm using bundling for css. When I created a new css stylesheet and used the same id names as another page in the application, the styles on the first page were messed up. I must be doing something wrong as I know that…
Samuel
  • 3
  • 3
0
votes
0 answers

Bundling CSS files in VS2012 Express Web

Mine is a peculiar situation. May be not. I have a solution in VS2012 Web Express. Not ASP.NET, not MVC. Just a solution full of static html files. I recently added a bunch (say 20 some) CSS files. I need to use some kind of bundling. Web Essentials…
0
votes
1 answer

ASP.NET Minification renders jquery.ajax error function with one parameter

I am using ASP.NET MVC 4 in VS2012. I am using bundles to minify my JavaScript code. My bundle code is: bundles.Add(new ScriptBundle("~/bundles/inline").Include("~/Scripts/inline/_layout_inline.js")); JavaScript source looks like this: function…
GregJF
  • 456
  • 4
  • 14
0
votes
1 answer

How to create physical directory with bundle and minification in amazon S3

Visual studio 2012 - Asp.net MVC3 I am using microsoft asp.net web optimization framework to make the bundle and minification, but I have a problem when using the bundle and minification, everything works normal place, but I need the virtual…
0
votes
1 answer

Unexpected token '.' when bundling stylesheets with MVC 4

BundleConfig.cs bundles.Add(new StyleBundle("~/Content/styles").Include( "~/Content/css/test.css" ) ); _Layout.cshtml @Scripts.Render("~/Content/styles") Test.css body{ font-size: 75%; color: #232323; text-align: left; margin: 0px; padding:…
RHarris
  • 10,641
  • 13
  • 59
  • 103
0
votes
4 answers

Couldn't bundle custom jquery scripts in ASP.NET MVC4

I've created some basic scripts using jquery and when placed below the markup in one of my MVC views, it works fine. I wanted to move those scripts to a separate file in Scripts folder, so I have created a file called 'CustomJquery.js' and have…
Ren
  • 1,493
  • 6
  • 31
  • 56