You can simply add PowerShell build step containing the following code:
(Get-Content "showVersion.js")
| Foreach { $_ -Replace "__build_ver_placeholder__", "%build.number%" }
| Set-Content "showVersion.js";
%build.number% variable will be replaced by TeamCity during the build