开发者

Ajax Minifier Visual Studio include all javascript files

I am using the Ajax Minifier http://www.ajaxprojects.com/ajax/tutorialdetails.php?itemid=766 and have embedded it in the csproj file for use in Visual Studio 2008 (not the free version). I have two folders, Content and Scripts, directly under the root of the project. Also, the Content folder has subfolders, and would like to include all of these as well (if I have to manually add each subfolder that is fine as well).

Currently, my csproj file looks like this (and is included within the Project tags as instructed). There are no build errors, the files simply do not get minified. (I've enabled Project -> View All files)

<Import Project="$(MSBuildExtensionsPath)\Microsoft\MicrosoftAjax\ajaxmin.tasks" />
开发者_运维技巧<Target Name="AfterBuild">
  <ItemGroup>
    <JS Include="Scripts\*.js" Exclude="Scripts\*.min.js;"/>
    <JS Include="Content\**\*.js" Exclude="Content\**\*.min.js;"/>
  </ItemGroup>
  <AjaxMin SourceFiles="@(JS)" SourceExtensionPattern="\.js$" TargetExtension=".min.js" />
</Target>

How would I edit the csproj file in order to include these folders?


Is this problem solved?

I use the following code and this works for me

  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\MicrosoftAjax\ajaxmin.tasks" />
  <Target Name="AfterBuild">
    <ItemGroup>
      <JS Include="**\*.js" Exclude="**\*.min.js" />
    </ItemGroup>
    <AjaxMin JsSourceFiles="@(JS)" JsSourceExtensionPattern="\.js$" JsTargetExtension=".min.js" />
  </Target>

I use the $(MSBuildExtensionsPath32) because ajaxmin is 32 bit and my windows is 64 bit so $(MSBuildExtensionsPath) goes to the 64 bit folder.


A little too late for this answer, but try this:

<JS Include="**\*.js" Exclude="**\*.min.js;"/>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜