Asp.net MVC Combres的简单用法
第一步:添加nuget包
【1】添加 nuget包后,会自动在 webconfig里面 添加配置文件(不用改)
<section name="dotless" type="dotless.Core.configuration.DotlessConfigurationSectionHandler, dotless.Core" /><section name="combres" type="Combres.ConfigSectionSetting, Combres" /></configSections> <namespaces> <add namespace="Combres" /> <add namespace="Combres.Mvc" /></namespaces> <combres definitionUrl="~/App_Data/combres.xml" />
【2】添加nuget包后,会在Global.asax文件里面添加一个注册
第三步:combres.xmls
<?xml version="1.0" encoding="utf-8" ?> <!-- This file contains basic settings needed for most web apps. For full Combres settings (with explanation), refer to the sample definition file: combres_full_with_annotation.xml Also, refer to Combres' documentation: http://combres.codeplex.com/documentation --> <combres xmlns='urn:combres'> <filters> <filter type="Combres.Filters.FixUrlsInCssFilter, Combres" /> </filters> <resourceSets url="~/combres.axd" defaultDuration="30" defaultVersion="201601081834"//版本号默认为 auto defaultDebugEnabled="false" //发布后为false,本地debug用 true defaultIgnorePipelineWhenDebug="true" localChangeMonitorInterval="30" remoteChangeMonitorInterval="60" > <!--公共Css-self插件--> <resourceSet name="mainCss" type="css"> <resource path="~/Styles/main.css" mode="dynamic" forwardCookie="false" /> </resourceSet> <resourceSet name="manageJs" type="js"> <resource path="~/Scripts/manage/manage.js" mode="dynamic" forwardCookie="false" /> </resourceSet> <resourceSet name="loginJs" type="js"> <resource path="~/Scripts/login/login.js" mode="dynamic" forwardCookie="false" /> </resourceSet> </resourceSets> </combres>
第四步:页面添加 引用