Implementing bundling into umbraco
Steps to implement
- Register umbracoReservedPaths in web.config
- Register Optimization
- Create Startup handler
Umbraco has reserved paths and in order to implement bundling we need to register the exception in web.config.
Nuget package Optimalization
In order to implement bundling, we need to have reference to System.Web.Optimalization namespace. If you do not have access to the namespace, It means that you need to add another nuget package to your solution.
Now the namespace can be used in any of your files by adding new using as follows:
Implementation of StartupHandler
The last piece to implement is Start up handler as follows. The example does contain sample css and js registration sample.