Closed ViRuSTriNiTy closed 8 months ago
This is really more of an MSBuild question and we're not experts on that. If it works, seems good, though?
This issue has been marked as "Question" and has seen no recent activity. It has been automatically closed for house-keeping purposes.
Side note:
Unfortunately, using the target configuration as described in the initial post breaks resx functionality. For now, the only solution is to either build twice to get fresh js files or move the resources to a separate project. In case NuGet packages are used, the separate project can then be automatically included, see https://josef.codes/dotnet-pack-include-referenced-projects.
Acknowledgement
Comment
Hi there,
I am using
Microsoft.TypeScript.MSBuild
to compile.ts
files to.js
files in my project. But additionally, I useNTypewriter.SourceGenerator
to generate.ts
files from C# code. These.ts
files should be compiled to.js
in one run, meaning I don't want to have to build twice to get a fresh.js
.When using diagnostic verbosity on building the project, I can see that
NTypewriter.SourceGenerator
is executed when theCoreCompile
target executes, the same seems to apply toMicrosoft.TypeScript.MSBuild
. So, both source generator andtsc
are executed at the same time and sincetsc
is somewhat slower, it cannot catch the output of the source generator in time.To somehow get it working, I thought about changing the execution order of the tasks by adding
to the project. This seems to work fine.
Is this the right approach or can I solve the issue in another / better way?
So lonG