Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET - script and css compression

Is there any native compression (for javascript/css files) available in ASP.NET?

like image 214
dev.e.loper Avatar asked May 19 '09 13:05

dev.e.loper


People also ask

What is difference between bundling and minification?

Bundling and minification are two techniques you can use in ASP.NET to improve page load performance for your web application. Bundling combines multiple files into a single file. Minification performs a variety of different code optimizations to scripts and CSS, which results in smaller payloads.

How minification is implemented 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 BundleConfig Cs in ASP NET MVC?

By default, the MVC application's BundleConfig (located inside App_Start folder) comes with the following code − public static void RegisterBundles(BundleCollection bundles) { // Following is the sample code to bundle all the css files in the project // The code to bundle other javascript files will also be similar to ...

How do I run BundleConfig?

Simply right-click the bundleconfig. json file to enable it. Clicking the menu item will prompt you with information about what will happen if you click the OK button. A NuGet package will be installed into the packages folder without adding any files to the project itself.


1 Answers

Try Chirpy. It mashes, minifies, and validates your javascript, stylesheet, and dotless files. You can use YUI Compressor or Google Closure Compiler.

http://chirpy.codeplex.com/

Or, for more info, check out:

http://www.weirdlover.com/2010/05/22/visual-studio-add-in-for-dotless-js-and-css-files/

like image 111
Evan Nagle Avatar answered Sep 20 '22 10:09

Evan Nagle