It should not matter.
The web.config is only read in at run-time, and does not effect the outcome of a pure compilation step.
If you are, however, packaging a web-site, by using MsBuild /T:Package, then the transform occurs as part of the packaging process, which occurs after the compilation step completes.
Hope this helps.