示例#1
0
        /// <summary>
        /// Adds nuglify services for smidge with optional code settings
        /// </summary>
        /// <param name="services"></param>
        /// <param name="nuglifySettings"></param>
        /// <returns></returns>
        public static IServiceCollection AddSmidgeNuglify(this IServiceCollection services,
                                                          NuglifySettings nuglifySettings = null)
        {
            //pre processors
            services.AddSingleton <IPreProcessor, NuglifyCss>();
            services.AddSingleton <IPreProcessor, NuglifyJs>();
            services.AddSingleton <ISourceMapDeclaration, SourceMapDeclaration>();

            services.AddSingleton <NuglifySettings>(provider => nuglifySettings ?? new NuglifySettings(new NuglifyCodeSettings(null), new CssSettings()));

            return(services);
        }
示例#2
0
        /// <summary>
        /// Adds nuglify services for smidge with optional code settings
        /// </summary>
        /// <param name="services"></param>
        /// <param name="nuglifySettings"></param>
        /// <returns></returns>
        public static IServiceCollection AddSmidgeNuglify(this IServiceCollection services,
                                                          NuglifySettings nuglifySettings = null)
        {
            //pre processors
            services.AddSingleton <IPreProcessor, NuglifyCss>();
            services.AddSingleton <IPreProcessor, NuglifyJs>();
            services.AddSingleton <ISourceMapDeclaration, SourceMapDeclaration>();

            services.AddSingleton <NuglifySettings>(provider => nuglifySettings ?? new NuglifySettings(new NuglifyCodeSettings(null), new CssSettings()));

            services.AddTransient <IConfigureOptions <SmidgeOptions>, NuglifySmidgeOptionsSetup>();

            //conventions
            services.AddSingleton <IFileProcessingConvention, NuglifyMinifiedFilePathConvention>();

            return(services);
        }
示例#3
0
 public NuglifyCss(NuglifySettings settings)
 {
     _settings = settings;
 }
示例#4
0
 public NuglifyJs(NuglifySettings settings, ISourceMapDeclaration sourceMapDeclaration)
 {
     _settings             = settings;
     _sourceMapDeclaration = sourceMapDeclaration;
 }