I'm setting up the dev environment for a new project. It's a Web API project that serves an @angular project from static files. In order to facilitate this, on post build, I run the angular cli's build function, then copy the files into wwwroot. That's all working fine.
However, I want to be able to have two different npm scripts run depending on whether the project is in Debug or Release mode. In my post build scripts, I tried this:
if "$(ConfigurationName)" == "Debug"
(
npm run build
)
else if "$(ConfigurationName)"=="Release"
(
npm run prod
)
but I'm getting
The command "if "" == "Debug"
(
npm run build
)
else if ""=="Release"
(
npm run prod
)" exited with code 255.
It looks like there's no value being provided for ConfigurationName. I've tried both debug and release mode and get the same error. Did the ConfigurationName variable change in VS 2017 or something?
EDIT: However, if I click Edit Post-build and then click Macros, I can see here that ConfigurationName has a value. It's just not seen by my script