Combres 结合了 JS 和 JS 技术。 CSS 文件但不缩小

发布于 2024-10-04 10:13:24 字数 2346 浏览 4 评论 0原文

你好 我刚刚将 Combres 添加到我的 ASP.NET MVC 项目中,它可以顺利地将 CSS 文件合并为一个 CSS 文件,将 JS 文件合并为一个 JS 文件,但由于某种原因,它没有缩小。

知道为什么吗? (注意 - 我刚刚添加了 yui 压缩器。它不会用它压缩我的文件...) 这是我的combres.xml:

<?xml version="1.0" encoding="utf-8" ?>
<combres xmlns='urn:combres'>
  <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>
  <resourceSets url="~/combres.axd" defaultDuration="30"
                                defaultVersion="auto"
                                defaultDebugEnabled="auto" >

    <resourceSet name="siteCss" type="css" minifierRef="yui">
      <resource path="~/Content/main.css" />
      <resource path="~/Content/css/superfish.css" />
      <resource path="~/Content/css/superfish-rtl.css" />
      <resource path="~/Content/prettyPhoto/css/prettyPhoto.css" />
    </resourceSet>

    <resourceSet name="siteJs" type="js">
      <resource path="~/Content/js/jquery-1.4.2.min.js" />
      <resource path="~/Content/js/superfish.js" />
      <resource path="~/Content/prettyPhoto/js/jquery.prettyPhoto.js" />
    </resourceSet>

    <resourceSet name="adminCss" type="css" minifierRef="yui">
      <resource path="~/Content/Site.css" />
      <resource path="~/Content/CKEditor/_samples/sample.css" />
      <resource path="~/Content/eggplantTheme/jquery-ui-1.8.2.custom.css" />
      <resource path="~/Content/TreeView/jquery.treeview.css" />     
    </resourceSet>

    <resourceSet name="adminJs" type="js">
      <resource path="~/Content/js/jquery-1.4.2.min.js" />
      <resource path="~/Content/js/jquery-ui-1.8.2.custom.min.js" />
      <resource path="~/Scripts/general2.js" />
      <resource path="~/Content/CKEditor/ckeditor.js" />
      <resource path="~/Content/CKEditor/_samples/sample.js" />
      <resource path="~/Content/CKEditor/lang/_languages.js" />
      <resource path="~/Content/TreeView/jquery.treeview.min.js" />
    </resourceSet>

  </resourceSets>
</combres>

hi
i've just added Combres to my ASP.NET MVC project and it combines the CSS files into one CSS and the JS files into one JS file smoothly, but for some reason it does that without minification.

any idea why ?
(note- i just added the yui minifier. it doesnt compress my file with it our with it...)
here's my combres.xml :

<?xml version="1.0" encoding="utf-8" ?>
<combres xmlns='urn:combres'>
  <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>
  <resourceSets url="~/combres.axd" defaultDuration="30"
                                defaultVersion="auto"
                                defaultDebugEnabled="auto" >

    <resourceSet name="siteCss" type="css" minifierRef="yui">
      <resource path="~/Content/main.css" />
      <resource path="~/Content/css/superfish.css" />
      <resource path="~/Content/css/superfish-rtl.css" />
      <resource path="~/Content/prettyPhoto/css/prettyPhoto.css" />
    </resourceSet>

    <resourceSet name="siteJs" type="js">
      <resource path="~/Content/js/jquery-1.4.2.min.js" />
      <resource path="~/Content/js/superfish.js" />
      <resource path="~/Content/prettyPhoto/js/jquery.prettyPhoto.js" />
    </resourceSet>

    <resourceSet name="adminCss" type="css" minifierRef="yui">
      <resource path="~/Content/Site.css" />
      <resource path="~/Content/CKEditor/_samples/sample.css" />
      <resource path="~/Content/eggplantTheme/jquery-ui-1.8.2.custom.css" />
      <resource path="~/Content/TreeView/jquery.treeview.css" />     
    </resourceSet>

    <resourceSet name="adminJs" type="js">
      <resource path="~/Content/js/jquery-1.4.2.min.js" />
      <resource path="~/Content/js/jquery-ui-1.8.2.custom.min.js" />
      <resource path="~/Scripts/general2.js" />
      <resource path="~/Content/CKEditor/ckeditor.js" />
      <resource path="~/Content/CKEditor/_samples/sample.js" />
      <resource path="~/Content/CKEditor/lang/_languages.js" />
      <resource path="~/Content/TreeView/jquery.treeview.min.js" />
    </resourceSet>

  </resourceSets>
</combres>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

朕就是辣么酷 2024-10-11 10:13:24

由于您将 defaultDebugEnabled 设置为 auto,因此将采用 web.config 中的调试设置。如果您处于调试模式(如 web.config 中指定),则不会进行缩小。将 defaultDebugEnabled 更改为 false 或在 ASP.NET 应用程序中切换到发布模式。

您可以参阅本文中的调试支持部分了解更多信息。

Since you set defaultDebugEnabled to auto, debug setting in web.config will be picked up. If you are in debug mode (as specified in web.config), there will be no minification. Either change defaultDebugEnabled to false or switch to release mode in your ASP.NET app.

You can refer to the section Debugging Support in this article for more information.

独享拥抱 2024-10-11 10:13:24

您必须启用缩小:请参阅这篇文章:http://www.codeproject.com/KB /aspnet/combres2.aspx

You have to enable minification: See this article: http://www.codeproject.com/KB/aspnet/combres2.aspx

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文