Using Jsmin build event in Visual Studio to combine files

579 views Asked by At

Im having trouble using JSmin to combine and minify my files on successful build:

I think my syntax is correct but the output is empty

if $(ConfigurationName) == Debug goto :exit
if $(ConfigurationName) == Alpha goto :combineLibsPluginsJs

goto :exit

REM This combines and minifies the Libraries and Plugins JavaScript
:combineLibsPluginsJs
"$(ProjectDir)\Tools\jsmin.exe" < "$(ProjectDir)\Resources\Scripts\Libraries\SomeJs.js" | "$(ProjectDir)\Resources\Scripts\Libraries\OtherLibStuff.js" > "$(ProjectDir)\Resources\min\LibrariesAndPlugins.js"

:exit
exit 0
1

There are 1 answers

0
t00thy On

The var $(ProjectDir) ends with "\", so the correct syntax is:

"$(ProjectDir)Tools\jsmin.exe" < "$(ProjectDir)Resources\Scripts\Libraries\SomeJs.js" | "$(ProjectDir)Resources\Scripts\Libraries\OtherLibStuff.js" > "$(ProjectDir)Resources\min\LibrariesAndPlugins.js"

This is old post, but it could help to somebody else.