Cannot publish when using single file output via TypeScriptOutFile
Copying file Scripts/compiledFromTS.js to obj\Release\Package\PackageTmp\Scrippts\compiledFromTS.js failed. Could not find file 'Scripts/compiledFromTS.js'.
This is because the individual js files are not generated with single file output. The single output is also not published.
Probably related to https://github.com/Microsoft/TypeScript/issues/3178
what version of TS are you using? if you are using 1.7.4, is it the same issue as https://github.com/Microsoft/TypeScript/issues/5894?
I'm using 1.7.6 with VS 2015. I can verify that ItemGroup's Content Include is using relative paths, not absolute like in https://github.com/Microsoft/TypeScript/issues/5894.
@mykohsu can you share your repro?
Unfortunately the repro is internal only so may be difficult to reproduce. Weirdly, this is now working - I suspect there was conflict with a gulp script.
However, is it a known issue that the single file output is not published unless that target file is also added to the project? Is this the desired behavior?
This may be related to the following:
Can you try the following in the TypeScript targets file for VS 2015 (C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\TypeScript), can you change the following line:
<TypeScriptBuildConfigurations Condition="'$(TypeScriptOutFile)' != ''">$(TypeScriptBuildConfigurations) --out "$(TypeScriptOutFile)"</TypeScriptBuildConfigurations>
to
<TypeScriptBuildConfigurations Condition="'$(TypeScriptOutFile)' != ''">$(TypeScriptBuildConfigurations) --outFile "$(TypeScriptOutFile)"</TypeScriptBuildConfigurations>
I changed --out to --outFile
@mykohsu any updates on this issue? did the workaround help?
I have the same issue where I am using typescript 1.8.6 with a tsconfig file specifying an outFile. This workaround didn't help.
What I did in the end is to add a build condition around the ItemGroup that contains all of my TypeScriptCompile elements to limit it to Debug mode. My publish settings are for a Release configuration and my ts outFile is included as part of the project so it gets copied on build.
Not ideal but it got me going.
<ItemGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <TypeScriptCompile Include="app\components\customer\app.ts" /> ... etc
Closing this as it's unclear we can actually do anything here. We fixed the issue where specifying the outfile option in the tsconfig.json file would not work with publishing.
@paulvanbrenk is there an update that will fix the TypeScript targets file without manually editing it?
@paulvanbrenk so, what's the solution.
@jamesfancy for which question? The original bug is fixed in 2.0.
@paulvanbrenk Thank you. I am waiting for 2.0 release.
With 1.8.6, this will work if you use the project properties instead of using a tsconfig.json. It's not ideal but it works on a build server without modifying targets.