public NUglifyJs(NUglifyJsOptions options) { if (options == null) { options = new NUglifyJsOptions(); } _codeSettings = options.CodeSettings; }
public static IServiceCollection AddNUglifyAll( this IServiceCollection collection, NUglifyCssOptions css = null, NUglifyHtmlOptions html = null, NUglifyJsOptions js = null) => collection .AddNUglifyCss(css) .AddNUglifyHtml(html) .AddNUglifyJs(js) ;
public static IServiceCollection AddNUglifyJs( this IServiceCollection collection, NUglifyJsOptions options = null) => collection.AddSingleton <IStaticFileTransform>(services => new StaticFileTransformBuilder().NUglifyJs(options).Build());
public static StaticFileTransformBuilder NUglifyJs(this StaticFileTransformBuilder builder, NUglifyJsOptions options = null) { var nuglify = new NUglifyJs(options); return(builder .Use((filename, provider) => { var content = provider.GetContent(filename); return content == null ? null : nuglify.Apply(filename, content); }) .IfMatches("js") .WithMinifierPriority()); }