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

Bundling and minification - when enabled scripts don't work

Trying to apply bundling to scripts, which worked fine when were located at pages in old way (manually). This is bundles registration: Bundle sbundle = new ScriptBundle("~/bundles/jqueryval").Include( "~/Scripts/jquery-{version}.js", …
Ryan
  • 609
  • 6
  • 13
0
votes
1 answer

Using MVC bundling to generate custom CSS from LESS files

I have a multiclient system whereby different clients have different brand colours. These colours are stored in the DB and referenced throughout my LESS files as @color{1-3}. We used to maintain a colors.less file with a reference to all places…
0
votes
1 answer

Absolute paths for resources in LESS CSS with ASP.net MVC

I know there are other questions, but none have the answer I need. Just need to be able to force an absolute path in some LESS that's included in an MVC page so that the images (etc) are correctly picked…
0
votes
2 answers

Asp.Net and jquery-ui: reference to not existing file requested on page

I am currently facing the problem that on one of my pages, the page requests a file named "jquery-ui-1.11.1.min.js" which causes a 404 file not found error. This is because the correct file name is "jquery-ui.min-1.11.1.js". So, for some reason,…
Cleo
  • 620
  • 2
  • 10
  • 32
0
votes
2 answers

Can I set a single .NET MVC bundle to always be bundled (even in debug mode)?

I am using .LESS variables in my files. I have a LessTransform in my Bundler, which allows all my .less to see the variables. But when I turn bundling off, obviously it no longer works! Can I see just a single bundle to always be bundled? (even when…
williamsandonz
  • 15,864
  • 23
  • 100
  • 186
0
votes
1 answer

Unable to generate 'VersionQueryString' in Scripts.Render when using bundle

This my settings: public static void RegisterBundles(BundleCollection bundles) { bundles.Add(new ScriptBundle("~/bundles/jquery").Include( "~/" + Links.Scripts.jquery_2_1_1_min_js, "~/" +…
0
votes
1 answer

ng-annotate control dependency name

Sorry if the title is wrong cause i couldn't figure out the best title for it. You can change it if you want to Constant File /* global lodash:false */ (function () { 'use strict'; angular .module('blocks.router') …
0
votes
2 answers

hooking into Google App Engine's deploy

The Google App Engine Launcher has a nice little "Deploy" button that will push my changes to prod. However, I'd like to be able to minify/obfuscate my JavaScript before deploying. I've read about several tools that can do this: Google Closure…
0
votes
1 answer

knockout.js external model js file

I have an MVC.NET app which using Knockout.js (+ knockout.mapping) to deal with some cascading dropdowns. The data for these comes from a WebAPI call to an external service. As it happens this service requires an authentication token which expires…
nat
  • 2,185
  • 5
  • 32
  • 64
0
votes
1 answer

Can I use .less in link element href cross-browser?

I'm developing an ASP.NET MVC application using dotless and bundling. When my CSS is optimised I get a link such as: However, when optimisation is disabled I get:
Curtis
  • 101,612
  • 66
  • 270
  • 352
0
votes
1 answer

ASP.NET MVC 5 Bundling feature

Does bundling (.js and .css) happen for each request? Or they will be created one time and cached for next requests? When does it create? Any affect on server CPU usage?
Babak
  • 3,716
  • 6
  • 39
  • 56
0
votes
1 answer

To bundle and minify JavaScript files, can I just concatenate file content then minify?

I have several JavaScript files that I need to bundle and minify manually. We can't use the standard System.Web.Optimization bundles on application start solution as it causes issues due to our complex caching needs. To bundle and minify these,…
andrewb
  • 5,200
  • 6
  • 36
  • 54
0
votes
1 answer

How can I preserve individual files when bundling?

Directory bundles can be created in this way... bundles.Add(new ScriptBundle("~/bundles/mybundle").IncludeDirectory( "~/Scripts/app/", "*.js")); The output (without token) of @Scripts.Url("~/bundles/mybundle") is…
0
votes
1 answer

SquishIt Framework causing KeyNotFoundException on the server

I am using the SquishIt Framework for minification and it is working fine on the local end but when I push it on the server I get KeyNotFoundException. Below is the stack trace for the error. Exception information: Exception type:…
Anshuman Jasrotia
  • 3,135
  • 8
  • 48
  • 81
0
votes
1 answer

Bundling content instead of references in ASP.Net 4.5.1?

Our single page web applications will be using some bootstrap modal windows. Bootstrap seems to hide them until they're needed so simply appending all the modal HTML to the bottom of the form seems like a simple enough plan. To help with…
Corey Ogburn
  • 24,072
  • 31
  • 113
  • 188