I am working on a MVC project with .NET 6. I am using WebOptimizer for bundling and minification. The documentation mentions creating a bundling pipeline, like below.
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.AddWebOptimizer(pipeline =>
{
pipeline.MinifyJsFiles("js/a.js", "js/b.js", "js/c.js");
});
}
I want all the bundling rules/pipeline to reside in a separate class/file. And reference that class/file in services.AddWebOptimizer()
. This way Startup.cs is much more readabile and
You can create a static separate class like below:
Then reference this class like below: