Compile less files in node.js project on Windows Azure

I have a node.js project that compiles less files to css when I start the app. I do this by modifying the start script in package.json like so:

{
    // omitted for brevity
    start: { lessc public/stylesheets/styles.less > public/stylesheets/styles.css; node app.js; }
}

This works nicely locally, but not at all on my Windows Azure instance. Either because less needs to be installed globally on the machine for this to work, or because Azure doesn't run npm start. Or both. Either way, I need another solution!

I thought custom deployments was the answer (I'm using git remote deployment) and I tried modifying the deploy.cmd to include

call "lessc public/stylesheets/styles.less > public/stylesheets/styles.css;"

No joy. I even tried

call "%SITE_ROOT%/node_modules/less/bin/lessc %SITE_ROOT%/public/stylesheets/styles.less > %SITE_ROOT%/public/stylesheets/styles.css;

Am I coming at this the wrong way? How can I keep the compiled css files out of my source control and compile them on the server after deployment to Azure?

Thanks!

OK, I finally have this going, I think.

For some reason, even though the physical file is on the disk (I can see them with my FTP client), Azure is not letting me run lessc in the \node_modules\less\bin folder, but it does let me run the version in the \node_modules\.bin folder.

In the end, I added the following lines to my deploy.cmd file, and it worked!

IF NOT DEFINED LESS_COMPILER (
  SET LESS_COMPILER=%DEPLOYMENT_TARGET%\node_modules\.bin\lessc
)

call %LESS_COMPILER% %DEPLOYMENT_TARGET%\public\stylesheets\styles.less > %DEPLOYMENT_TARGET%\public\stylesheets\styles.css