-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
[Preview 8] Typescript generated js file in wwwroot in RCL not included #13122
Comments
Thanks for contacting us, @MarkStega. |
In the meantime, what is the "magic sauce" needed to force the inclusion of generated wwwroot\js files as content? |
@mkArtakMSFT I have a github repo here https://github.com/SQL-MisterMagoo/BlazorPreview_8_Typescript_Sample - where the Typescript file is correctly compiled to a JS file and is included as a static web asset. The JS content is served up correctly in the Server-side blazor project, but only if the ASPNETCORE_ENVIRONMENT is set to Development. If you change that environment setting, the asset is no longer served. This means you cannot publish the Server-Side Blazor project and expect static web assets to work. The repo contains one Client-Side project, one Server-Side project and a component library - all produced using the templates from preview 8. The RCL project also has EmbeddedResources because that is the only way to get the static web assets to work in Client-Side currently. Hopefully this helps with reproducing the problems. |
Thanks for the info, @SQL-MisterMagoo. For context to others, this is scheduled to be handled during preview 9, so not much left for this to be handled. |
You need to add TypeScriptCompile as a dependency for resolving the static web assets for the current project so that the typescript build happens before we compute the list of static web assets for the current project. <ResolveCurrentProjectStaticWebAssetsInputsDependsOn>
TypeScriptCompile;
$(ResolveCurrentProjectStaticWebAssetsInputsDependsOn)
</ResolveCurrentProjectStaticWebAssetsInputsDependsOn> You might also need to remove any unwanted output to prevent them from being included as content or contentFiles in the package. You can do so by adding your own custom target. This will work in preview9 and onwards. |
Filed an issue to track the addition to the docs. dotnet/AspNetCore.Docs#13969 Closing this one as there's no further action to be taken here. |
If you believe you have an issue that affects the security of the platform please do NOT create an issue and instead email your issue details to secure@microsoft.com. Your report may be eligible for our bug bounty but ONLY if it is reported through email.
Describe the bug
Typescript generated js file in wwwroot in Razor Class Library not included as content.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Expect JS that was generated by TSC to be included as a static asset without having to manually create a target for the generated file.
The text was updated successfully, but these errors were encountered: