2

I am trying to use JSMin to compress Javascript on a .NET project, but since I don't want to create another dependency on the project I was wondering how could I have the executable file on my source control so that when building the project, so that I could "run" that executable on a post build event.

Any thoughts ?

jAlpedrinha
  • 179
  • 1
  • 7
  • are you using jsmin just as a method of obfuscation or just to reduce size? – Icarus Feb 02 '12 at 15:20
  • how is this related to msbuild? – scrat.squirrel Feb 02 '12 at 20:36
  • woohoo it is related to MSBuild since I want my build to integrate code obfuscation and minimization ... Icarus, actually I'm using more than just JSMin, I'm trying to integrate requireJS also, and instead of serving one module per file I want to serve a single file.js and centrally manage modules instead of managing files for each page. – jAlpedrinha Apr 12 '12 at 09:32

1 Answers1

1

If you work with Visual Studio 2010, you can select your project, then right click, select Properties. When the Properties tab opens, select "Build Events". In the "Post-build event command line", type your command, for example:

c:\pathto\myprogram.exe dothis

Please note that there are some built-in variables you can use in such case, for example: $(ProjectDir) and $(OutDir).

But that can also be done in a MSBuild project as well.

scrat.squirrel
  • 3,607
  • 26
  • 31