/// <inheritdoc cref="IResourceMinifier.Minify" />
        public string Minify(Settings settings, ResourceSet resourceSet, string combinedContent)
        {
            var outputMode = (OutputMode)OutputMode.ConvertToType(
                typeof(OutputMode), Microsoft.Ajax.Utilities.OutputMode.SingleLine);
            var codeSettings = new CssSettings()
            {
                OutputMode        = outputMode,
                MinifyExpressions = MinifyExpressions == null ? true : MinifyExpressions.Value,
            };

            return(new Minifier().MinifyStyleSheet(combinedContent, codeSettings));
        }
示例#2
0
        /// <inheritdoc cref="IResourceMinifier.Minify" />
        public string Minify(Settings settings, ResourceSet resourceSet, string combinedContent)
        {
            var localRenaming = (LocalRenaming)LocalRenaming.ConvertToType(
                typeof(LocalRenaming), Microsoft.Ajax.Utilities.LocalRenaming.CrunchAll);
            var outputMode = (OutputMode)OutputMode.ConvertToType(
                typeof(OutputMode), Microsoft.Ajax.Utilities.OutputMode.SingleLine);
            var codeSettings = new CodeSettings
            {
                MacSafariQuirks      = MacSafariQuirks == null ? true : MacSafariQuirks.Value,
                CollapseToLiteral    = CollapseToLiteral == null ? true : CollapseToLiteral.Value,
                LocalRenaming        = localRenaming,
                OutputMode           = outputMode,
                RemoveUnneededCode   = RemoveUnneededCode == null ? true : RemoveUnneededCode.Value,
                StripDebugStatements = StripDebugStatements == null ? true : StripDebugStatements.Value
            };

            return(new Minifier().MinifyJavaScript(combinedContent, codeSettings));
        }