3

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>
danfromisrael
  • 2,982
  • 3
  • 30
  • 40

2 Answers2

8

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.

Buu
  • 49,745
  • 5
  • 67
  • 85
-1

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

Jan Hančič
  • 53,269
  • 16
  • 95
  • 99
  • i've followed this article every step (for regular minification) and didnt see the enable minification option. can u point where it is or write the necessary code to make it work? thanks. – danfromisrael Nov 25 '10 at 13:25