-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Building assets using MSBuild & NPM needs further clarification #42409
Comments
Hey @MarkStega, thanks for reaching out. I believe #38445 may achieve what you're looking for here. |
@MarkStega the package in the blog post should be completely usable (it's a bunch of MSBuild) and as @TanayParikh mentions, we are productionizing a "more complete" version of the package as part of #38445 built in directly into the SDK. For an immediate solution, I would switch to the provided package. That should do all the invocations at the right time and handle all the incrementalism. |
@TanayParikh Thanks, I believe I could make that work as long as I have the ability to have multiple 'generate' entries. I put in a longer comment in #38445 as to why I think that is desirable. @javiercn I'll look at the package again but I couldn't figure out how to separate js & css builds. |
@MarkStega the package is setup to build all the assets as a single step. If you want to have separate sets of things to build, you can replicate what is done in the blog post to add a separate target for CSS. The support we plan to build in the SDK will allow you to have multiple tools and commands out of the box. |
@MarkStega we will be using #38445 to track this issue. |
Last year @javiercn helped with a resource bundling issue (#35274). Unfortunately, there is an undesirable side-effect of the method (see the end of #42374 for a demonstration of the problem). I went back to the blog post https://devblogs.microsoft.com/dotnet/build-client-web-assets-for-your-razor-class-library/ and it appears that the reference library never made it out of the alpha stage of development. The sample app doesn't help as it is based upon the same alpha build.
My referenced csproj material.blazor.csproj does the build of js & css assets properly (and builds them only if the outputs are missing or out of date) but is apparently running the npm commands too late to have the generated assets in wwwroot recognized as static web assets.
So three questions/comments:
to an earlier build step. If so, what step would be appropriate. (and are the build steps documented)?
The text was updated successfully, but these errors were encountered: