private string CompressCss(string outputFilePath, List <string> files, ICssCompressor compressor, bool appendHashToAssets) { var outputCss = new StringBuilder(); foreach (string file in files) { string css; if (file.ToLower().EndsWith(".less") || file.ToLower().EndsWith(".less.css")) { css = ProcessLess(file); } else { css = ReadFile(file); } if (processImports) { css = ProcessImport(css); } ICssAssetsFileHasher fileHasher = null; if (appendHashToAssets) { var fileResolver = new FileResolver(); fileHasher = new CssAssetsFileHasher(hashQueryStringKeyName, fileResolver, hasher); } css = CssPathRewriter.RewriteCssPaths(outputFilePath, file, css, fileHasher); outputCss.Append(css + "\n"); } return(compressor.CompressContent(outputCss.ToString())); }
public CssCompressorTask(ICssCompressor compressor) : base(compressor) { this.compressor = compressor; }
private StringBuilder CompressCss(string outputFilePath, List<string> files, ICssCompressor compressor) { var outputCss = new StringBuilder(); foreach (string file in files) { string css; if (file.ToLower().EndsWith(".less") || file.ToLower().EndsWith(".less.css")) { css = ProcessLess(file); } else { css = ReadFile(file); } if (processImports) { css = ProcessImport(css); } css = CssPathRewriter.RewriteCssPaths(outputFilePath, file, css); outputCss.Append(compressor.CompressContent(css)); } return outputCss; }
public CssCompressorTask(ICssCompressor compressor) : base(compressor) { _compressor = compressor; }
public YuiCssCompressor(ICssCompressor compressor) { _compressor = compressor; }
private StringBuilder CompressCss(List<string> files, ICssCompressor compressor) { var outputCss = new StringBuilder(); foreach (string file in files) { if (Path.GetExtension(file).ToLower() == ".less") { string css = ProcessLess(file); outputCss.Append(compressor.CompressContent(css)); } else { string css = ReadFile(file); outputCss.Append(compressor.CompressContent(css)); } } return outputCss; }
public AssetsProvider(IConfigurationRoot config, ICssCompressor cssCompressor, IJavaScriptCompressor javaScriptCompressor) { _config = config; _cssCompressor = cssCompressor; _javaScriptCompressor = javaScriptCompressor; }
private StringBuilder CompressCss(string outputFilePath, List <string> files, ICssCompressor compressor) { var outputCss = new StringBuilder(); foreach (string file in files) { string css; if (file.ToLower().EndsWith(".less") || file.ToLower().EndsWith(".less.css")) { css = ProcessLess(file); } else { css = ReadFile(file); } if (processImports) { css = ProcessImport(css); } css = CssPathRewriter.RewriteCssPaths(outputFilePath, file, css); outputCss.Append(compressor.CompressContent(css)); } return(outputCss); }
public string CompressCss(string outputFilePath, List <string> files, string compressorType) { ICssCompressor compressor = CssCompressorRegistry.Get(compressorType); return(CompressCss(outputFilePath, files, compressor).ToString()); }
public CssBundleAdapterCompressorTask(ICssCompressor compressor) : base(compressor) { this._compressor = compressor; }
public ICssBundleBuilder WithCompressor(ICssCompressor cssCompressor) { this.cssCompressorInstance = cssCompressor; return(this); }
public ICssBundleBuilder WithCompressor(CssCompressors cssCompressor) { this.cssCompressorInstance = MapCompressorEnumToType(cssCompressor); return(this); }
private string CompressCss(string outputFilePath, List<string> files, ICssCompressor compressor, bool appendHashToAssets) { var outputCss = new StringBuilder(); foreach (string file in files) { string css; if (file.ToLower().EndsWith(".less") || file.ToLower().EndsWith(".less.css")) { css = ProcessLess(file); } else { css = ReadFile(file); } if (processImports) { css = ProcessImport(css); } ICssAssetsFileHasher fileHasher = null; if (appendHashToAssets) { var fileResolver = new FileResolver(); fileHasher = new CssAssetsFileHasher(hashQueryStringKeyName, fileResolver, hasher); } css = CssPathRewriter.RewriteCssPaths(outputFilePath, file, css, fileHasher); outputCss.Append(css + "\n"); } return compressor.CompressContent(outputCss.ToString()); }
public ICssBundleBuilder WithCompressor(ICssCompressor cssCompressor) { this.cssCompressorInstance = cssCompressor; return this; }
public ICssBundleBuilder WithCompressor(CssCompressors cssCompressor) { this.cssCompressorInstance = MapCompressorEnumToType(cssCompressor); return this; }