1

My .NET Core 2 app uses build scripts (webpack), defined in .csproj file like so :

<Target Name="BuildScript" BeforeTargets="Build">
    <Exec Command="webpack" />
</Target>

This app is deployed to an Azure App Service through continuous deployment (Bitbucket). Deployment fails in "Running deployment command" obviously, because it tries to execute command "webpack".

I need my project to run webpack automatically during dev to bundle my js files ; but I don't want azure deployment to run webpack.

So what should I do ?

Thanks

1 Answer 1

2

Would using Target Condition help? Something like -

Condition="'$(CONFIG)'=='DEBUG'"

Reference: https://msdn.microsoft.com/en-us/library/7szfhaft.aspx

Sign up to request clarification or add additional context in comments.

1 Comment

Yes, my research led me to this possibility. Tried it out, and it works for me. Precisely, I added a custom environment variable, that I can call in that "Condition" property. It works, but I'm still open to remarks about the best way to manage this build stuff !

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.