It looks like Bundling and Minification are no longer built into MVC 6 since there is no more App_Start
and Bundle.Config
.
Is this going to be the case after final release?
I'm guessing Grunt should be used since that seems to be baked into Visual Studio 2015.
UPDATE: It looks like Microsoft has switched to Gulp instead of Grunt in RC1.
Bundling and minification are two techniques you can use in ASP.NET 4.5 to improve request load time. Bundling and minification improves load time by reducing the number of requests to the server and reducing the size of requested assets (such as CSS and JavaScript.)
Bundling allows us to load the bunch of static files from the server in a single HTTP request. The following figure illustrates the bundling technique: Loading script files in separate requests. In the above figure, the browser sends two separate requests to load two different JavaScript file MyJavaScriptFile-1.
The MVC provides us the two features to reduce the number of requests to access the resource file on the server i.e. Bundling and Minification. Bundling is one of the features of MVC. By implementing this, we can improve performance request load time.
What is bundling and minification. Bundling and minification are two distinct performance optimizations you can apply in a web app. Used together, bundling and minification improve performance by reducing the number of server requests and reducing the size of the requested static assets.
The default ASP.NET Core MVC 6 project template uses a Bundler & Minifier extension. The default template used to use Gulp which was far more powerful but it was deemed too complex for newbie developers who wanted something simple. You can read more about the switch away from Gulp and the reasoning here or read the documentation for the Bundler & Minifier extension here.
A much nicer and far more powerful method is to use Gulp, or any other task runner (There are others named Grunt, Brocoli etc. Gulp is apparently nicer to work with and newer than Grunt but also more popular than Brocoli). You can use the ASP.NET MVC Boilerplate project template to get a project with Gulp built in.
The new kid on the block is called WebPack which is according to Google about as popular as Gulp at the moment.
The old bundling and minification in ASP.NET MVC 5 has been dropped but there is a project on GitHub to build it for MVC 6 called Smidge.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With