Files
Umbraco-CMS/src/Umbraco.Web.Common/Extensions/UmbracoApplicationBuilder.RuntimeMinification.cs
Shannon ab66a9f33c Adds new method WithCustomDefaultMiddleware
To be able to fully customize the default middleware pipeline. Renames some interfaces and methods to be more consistent. Changes the startup builder interface types to be more type safe.
2021-07-16 16:04:14 -06:00

33 lines
846 B
C#

using System;
using Smidge;
using Smidge.Nuglify;
using Umbraco.Cms.Web.Common.ApplicationBuilder;
using Umbraco.Extensions;
namespace Umbraco.Cms.Web.Common.Extensions
{
public static partial class UmbracoApplicationBuilderExtensions
{
/// <summary>
/// Enables runtime minification for Umbraco
/// </summary>
public static IUmbracoEndpointBuilderContext UseUmbracoRuntimeMinificationEndpoints(this IUmbracoEndpointBuilderContext app)
{
if (app == null)
{
throw new ArgumentNullException(nameof(app));
}
if (!app.RuntimeState.UmbracoCanBoot())
{
return app;
}
app.AppBuilder.UseSmidge();
app.AppBuilder.UseSmidgeNuglify();
return app;
}
}
}