I added the optimizer step as a Pre Build step.
So in the Pre Build Events box in the project properties of your web project I added this:
cd $(ProjectDir)App\durandal\amd
optimizer.exe
main-built.js is then generated as part of the build process.
Note you will probably have to add the main-built.js file to your project for it to be deployed automatically if you are using msdeploy. I had to do this because we are using TFS hosted build service with automatic Azure publishing. Without this step the file was not being deployed.