I have the following script in my project.json
file which I am using to build my class library project into a NuGet package. I don't want to build any Debug NuGet packages. How can I limit this script to only run when the solution configuration is set to Release mode to speed up the build time in debug mode?
Alternatively, as a matter of curiosity, how can I pass the solution configuration into the command below so that 'Release' is not hard coded.
"scripts": {
"postcompile": [
"dotnet pack --no-build --configuration Release"
]
}