-
Notifications
You must be signed in to change notification settings - Fork 12.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using the MSBuild package with Blazor library extra content files are added to nupkg #42907
Comments
Interesting issue, thanks for pointing it out. It's currently intentional that the TS NuGet package includes the output as |
If we could have a condition for the |
For the sake of giving more context on this, if you build the project using This is how VS 2019 sees the project: Note that there are links on It indeed looks like the TS package adds everything from the project as |
@attilah so I don't know how much you're going to like this, but one workaround I found is to override the offending target by adding this to your <Target Name="GetTypeScriptOutputForPublishing" /> Still should investigate the inner workings of this and find out how we can integrate better with Blazor though. |
@minestarks Yeah....as a last resort that could work I intentionally did not bring it up as a possible solution :D :D :D I'd appreciate if we can fix it in a proper way. Of course as a workaround target override is fine! |
@attilah ah yes, you already got there before me! I can't see any downsides to your suggestion of adding a condition to optionally disable the target. This is what I'll do if there's no more elegant integration we can come up with. |
Any news on this? It is still an issue with Blazor 6, .NET 6 and/or VS 2022. I just stumbled across this and took me a while to figure this out ... EDIT: The workaround mentioned is not working anymore. On .NET 6 you have to first run Do not try to add |
JS files generated by the blazor projects are not included in the staticwebassets folder in the nuget package, but in the content and contentFiles folders. More details: microsoft/TypeScript#42907
Bug Report
When using the
Microsoft.Typescript.MSBuild
4.2.1-rc to pack a Blazor Library project for nuget package, the compiled javascript files are added to thecontent
andcontentFiles
folders of the nuget package, not just tostaticWebAssets
that Blazor build picks up.GetTypeScriptOutputForPublishing
MSBuild target seems to be the source of errors, if the content of that target is commented out, the nuget package does not have the above problem.UPDATE
The real sideeffects of this coming to the surface when the build nuget package is consumed in another Blazor project and being built in VS 2019 16.x. As the JS files are showing up in the consuming project as project items and they should not. The worse thing is that if you put a tsconfig.json into the Logging package no matter if it is a
<None....
item, that will also be packed and will cause compilation failure in the consuming project as there will be no source files to compile (that's how we started to notice this problem).Repro
🔎 Search Terms
msbuild, nuget, blazor
🙁 Actual behavior
See in summary above.
🙂 Expected behavior
Nuget package should not have those extra files.
The text was updated successfully, but these errors were encountered: