public static void Create(JsMinifierConfiguration config) { var builder = new ContainerBuilder(); builder.RegisterType<TraceLogger>().As<ILogger>(); builder.RegisterType<Http.Http>().As<Http.IHttp>(); builder.RegisterType<Engine.IncludeExcludeEngineFactory>().As<Engine.IEngineFactory>(); builder.RegisterType<FileResolver.AbsolutePathResolver>().As<FileResolver.IFileResolver>(); if (config.Cache) { builder.RegisterType<Response.CachedResponse>().As<Response.IResponse>() .WithParameter(new NamedParameter("isCompressionHandledByResponse", true)); builder.RegisterType<MinifyEngineWithCache>().As<IMinifyEngine>(); builder.RegisterType<PlainEngineWithCache>().As<IPlainEngine>(); } else { builder.RegisterType<Response.NonCachedResponse>().As<Response.IResponse>() .WithParameter(new NamedParameter("isCompressionHandledByResponse", true)); builder.RegisterType<MinifyEngine>().As<IMinifyEngine>(); builder.RegisterType<PlainEngine>().As<IPlainEngine>(); } builder.RegisterType<Cache.AspCache>().As<Cache.ICache>(); builder.RegisterType<Reader.Reader>().As<Reader.IReader>(); builder.RegisterInstance(config).As<Configuration.JsMinifierConfiguration>(); builder.RegisterType<JsMinifier>(); Instance = builder.Build(); }
public IncludeExcludeEngineFactory(IPlainEngine plainEngine, Engine.Minify.IMinifyEngine minifyEngine, Http.IHttp http, Configuration.JsMinifierConfiguration configuration) { _plainEngine = plainEngine; _minifyEngine = minifyEngine; _http = http; _configuration = configuration; }
public static JsMinifierConfiguration GetDefault() { var jsMinifierConfiguration = new JsMinifierConfiguration(); jsMinifierConfiguration.Cache = true; return jsMinifierConfiguration; }