concept minification in category asp.net

This is an excerpt from Manning's book ASP.NET Core in Action.
In the next chapter, we’re going to be looking at your ASP.NET Core application from a different point of view. Instead of focusing on the code and logic behind your app, we’re going to look at how you prepare an app for production. You’ll see how to specify the URLs your application uses, and how to publish an app so that it can be hosted in IIS. Finally, you’ll learn about the bundling and minification of client-side assets, why you should care, and how to use BundlerMinifier in ASP.NET Core.
In the final section of this chapter, we look at a common optimization step used when deploying your application. Bundling and minification are used to reduce the number and size of requests that browsers must make to your app to fully load a page. I show you how to use a simple tool to create bundles when you build your application, and how to conditionally load these when in production to optimize your app’s page size.
This function takes a total of 588 bytes as it’s currently written, but after minification, that’s reduced to 95 bytes—16% of its original size. The behavior of the code is identical, but the output, shown in the following listing, is optimized to reduce its size. It’s clearly not something you’d want to debug, but you’d only use minified versions of your file in production; you’d use the original source files when developing.
Listing 16.5. Example JavaScript function after minification
function myFunc(){function r(n,t){return n+t}var n=0,t;if(1)for(t=0;i<10;i++)n=r(n,t);return n}Optimizing your static files using bundling and minification can provide a free boost to your app’s performance when you deploy your app to production, while letting you develop using easy-to-read and separated files.
You can install a Visual Studio extension to control bundling and minification, or you can install the BuildBundlerMinifier package to automatically perform bundling and minification on each build of the project. The settings for bundling and minification are stored in the bundleconfig.json file, where you can define the different output bundle files and choose which files to include in the bundle. You can explicitly specify files, or you can use globbing patterns to include multiple files using wildcard characters.