這應該仍然可以與VS2010通過編輯csproj aka msbuild文件。
取自CodePlex上的this thread。
<ItemGroup>
<JavaScriptFiles Remove="@(JavaScriptFiles)" />
<JavaScriptFiles Include="../js/2.js"/>
</ItemGroup>
<CompressorTask
JavaScriptFiles="@(JavaScriptFiles)"
ObfuscateJavaScript="True"
PreserveAllSemicolons="False"
DisableOptimizations="Nope"
EncodingType="Default"
DeleteJavaScriptFiles="false"
LineBreakPosition="-1"
JavaScriptOutputFile="../js/2.min.js"
LoggingType="ALittleBit"
ThreadCulture="en-au"
IsEvalIgnored="false"/>
<ItemGroup>
<JavaScriptFiles Remove="@(JavaScriptFiles)" />
<JavaScriptFiles Include="../js/3.js" />
<JavaScriptFiles Include="../js/4.js" />
</ItemGroup>
<CompressorTask
CssFiles="@(CssFiles)"
DeleteCssFiles="false"
CssOutputFile="../css/release.css"
CssCompressionType="YuiStockCompression"
JavaScriptFiles="@(JavaScriptFiles)"
ObfuscateJavaScript="True"
PreserveAllSemicolons="False"
DisableOptimizations="Nope"
EncodingType="Default"
DeleteJavaScriptFiles="false"
LineBreakPosition="-1"
JavaScriptOutputFile="../js/3.min.js"
LoggingType="ALittleBit"
ThreadCulture="en-au"
IsEvalIgnored="false"/>
或者你也可以使用後生成事件,並將它運行一個自定義的MSBuild文件。 :) – 2010-08-17 13:14:07