gpt4 book ai didi

asp.net-mvc - 如何优化 Combres 设置(压缩、缩小)

转载 作者:行者123 更新时间:2023-12-01 08:40:59 26 4
gpt4 key购买 nike

谁能告诉我最佳的 Combres 设置?我有以下内容,但似乎我的 CSS 和我的 JS 没有被缩小。

<?xml version="1.0" encoding="utf-8" ?>
<combres xmlns='urn:combres'>
<filters>
<filter type="Combres.Filters.FixUrlsInCssFilter, Combres" />
<filter type="Combres.Filters.DotLessCssFilter, Combres" acceptedResourceSets="dotLessCss" />
</filters>
<cssMinifiers>
<minifier name="yui" type="Combres.Minifiers.YuiCssMinifier, Combres">
<param name="CssCompressionType" type="string" value="StockYuiCompressor" />
<param name="ColumnWidth" type="int" value="-1" />
</minifier>
</cssMinifiers>
<jsMinifiers>
<minifier name="msajax" type="Combres.Minifiers.MSAjaxJSMinifier, Combres" binderType="Combres.Binders.SimpleObjectBinder, Combres">
<param name="CollapseToLiteral" type="bool" value="true" />
<param name="EvalsAreSafe" type="bool" value="true" />
<param name="MacSafariQuirks" type="bool" value="true" />
<param name="CatchAsLocal" type="bool" value="true" />
<param name="LocalRenaming" type="string" value="CrunchAll" />
<param name="OutputMode" type="string" value="SingleLine" />
<param name="RemoveUnneededCode" type="bool" value="true" />
<param name="StripDebugStatements" type="bool" value="true" />
</minifier>
</jsMinifiers>

<resourceSets url="~/Extras"
defaultDuration="30"
defaultVersion="auto"
defaultDebugEnabled="auto" >

<resourceSet name="siteMaster.Js" type="js">
<resource path="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" mode="dynamic" />
<resource path="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.min.js" mode="dynamic" />
<resource path="~/Assets/Scripts/jquery.corner.js" />
<resource path="~/Assets/Scripts/MyApp.Combined.Master.js" />
</resourceSet>

<resourceSet name="mobileMaster.Js" type="js">
<resource path="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" mode="dynamic" />
<resource path="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.min.js" mode="dynamic" />
<resource path="~/Assets/Scripts/jquery.corner.js" />
<resource path="~/Assets/Scripts/MyApp.Combined.Master.js" />
</resourceSet>

<resourceSet name="siteMaster.Css" type="css">
<resource path="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/base/jquery-ui.css" mode="dynamic" />
<resource path="~/Assets/Css/Site.css" />
</resourceSet>

<resourceSet name="mobileMaster.Css" type="css">
<resource path="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/base/jquery-ui.css" mode="dynamic" />
<resource path="~/Assets/Css/Mobile.css" />
</resourceSet>

<resourceSet name="bingMaps.js" type="js">
<resource path="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2" mode="dynamic" />
<resource path="~/Assets/Scripts/Bing-Maps.js" />
</resourceSet>
</resourceSets>
</combres>

最佳答案

在每个 resourceSet 标签中明确设置你的缩小器

<resourceSet name="jsSet" type="js" version="1" minifierRef="yui" ...

或者使用 defaultJSMinifierRefdefaultCssMinifierRef

在 resourceSets 标签中全局设置缩小器
<resourceSets url="~/combres.axd" 
localChangeMonitorInterval="30"
remoteChangeMonitorInterval="120"
defaultDuration="30"
defaultVersion="1"
defaultVersionGenerator="Combres.VersionGenerators.Sha512VersionGenerator"
defaultJSMinifierRef="yui"
defaultCssMinifierRef="yui" ...

关于asp.net-mvc - 如何优化 Combres 设置(压缩、缩小),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3260327/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com