Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET MVC Optimization: Bundling without minifying?

Is it possible to bundle a set of scripts without minifying them? I just want to combine several third-party script files where I never need the non-minified versions. Some of these have warned against further minification.

like image 701
Brian Vallelunga Avatar asked May 21 '13 18:05

Brian Vallelunga


People also ask

How does bundling increase performance in MVC?

To improve the performance of the application, ASP.NET MVC provides inbuilt feature to bundle multiple files into a single, file which in turn improves the page load performance because of fewer HTTP requests.

How do we implement bundling in MVC?

To enable bundling and minification, set the debug value to "false". You can override the Web. config setting with the EnableOptimizations property on the BundleTable class. The following code enables bundling and minification and overrides any setting in the Web.

What is difference between bundling and minification?

Both bundling and minification are the two separate techniques to reduce the load time. The bundling reduces the number of requests to the Server, while the minification reduces the size of the requested assets.

What must be done to enable bundling and minification?

Bundling and minification is enabled or disabled by setting the value of the debug attribute in the compilation Element in the Web. config file. In the following XML, debug is set to true so bundling and minification is disabled. To enable bundling and minification, set the debug value to "false".


1 Answers

Just use the Bundle class and don't specify any transforms. The ScriptBundle/StyleBundles are automatically registering transforms that do minification.

like image 118
Hao Kung Avatar answered Sep 22 '22 18:09

Hao Kung