Basically, my end goal is to remove already present .min.js and CSS files when building my Visual Studio solution while I have Ajax Minifier (version 4.20) as one of MSBuild task which minifies .js and .css files.
According to Ajax Minifier documentation, I could use the -clobber
option to achieve the above mentioned goal. However, I'm not able to figure out where in Visual Studio MSBuild project task I can use this option. I'm successfully able to use the -clobber
option from Ajax Minifier command-line tool though.
Here is the configuration code which I have in my project (.csproj) file...
<Import Project="$(MSBuildExtensionsPath)\Microsoft\MicrosoftAjax\ajaxmin.tasks" />
<Target Name="AfterBuild">
<ItemGroup>
<JS Include="**\*.js" Exclude="**\*.min.js;Scripts\*.js" />
</ItemGroup>
<ItemGroup>
<CSS Include="**\*.css" Exclude="**\*.min.css" />
</ItemGroup>
<AjaxMin JsSourceFiles="@(JS)" JsSourceExtensionPattern="\.js$" JsTargetExtension=".min.js" CssSourceFiles="@(CSS)" CssSourceExtensionPattern="\.css$" CssTargetExtension=".min.css" clobber="true" />
</Target>
However, when I compiled my solution, I got following error - not sure why?
The "clobber" parameter is not supported by the "AjaxMin" task. Verify the parameter exists on the task, and it is a settable public instance property.