简体   繁体   中英

Visual Studio: Running jsmin as a post-build event

I'm trying to add jsmin.exe as a post-build event to my VS 2010 project but I get "error code 9009" when I try to build my project.

I've tested at the command prompt and found that if I navigate to the folder, then run

jsmin < debug.js > min.js

Then it works fine.

However, if I run the command from C:\\ and enter the full path, it returns

'C:\\Users\\Andrew\\Documents\\Visual' is not recognized as an internal or external command, operable program or batch file.

So my conclusion is that jsmin doesn't appear to like spaces in the file path. Given that Visual Studio's convention is to store the projects in a sub-folder of \\Visual Studio 2010\\, can anyone suggest how I can get around this issue?

Sounds like you need to put double-quotes around the path.

eg:

jsmin <"$(ProjectDir)\\debug.js" >"$(ProjectDir)\\min.js"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM