Run msbuild target only during dotnet pack
Is it possible to run a msbuild target in a csproj only when it's packaged to a nuget package, i.e.
dotnet pack MyProject should cause the target to run while dotnet build MyProject shouldn't.