Skip to content
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

Razor class libraries and static web assets #506

Open
NormanM123 opened this issue Aug 3, 2024 · 1 comment
Open

Razor class libraries and static web assets #506

NormanM123 opened this issue Aug 3, 2024 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@NormanM123
Copy link

NormanM123 commented Aug 3, 2024

Describe the Bug

When using nugetizer to pack Razor class libraries, static web assets that are generated during the build process (like scoped CSS or JavaScript files collocated with a component) are not included in the package. Files under "./wwwroot" are placed under ".contentFiles" in the package, which is the wrong location.

Steps to Reproduce

Create a Razor class library project and add the dependency to nugetizer. In the subfolder "./Components", add a Razor Component "Test.razor" and a scoped CSS file "Test.razor.css." with arbitrary content.

Create a file test.js in the "./wwwroot" folder.

Run dotnet pack on the project.

Expected Behavior

There should be a folder "./staticwebassets" within the package and another .props file in the build folder which copies the static assets during builds of projects that depend on the generated package.

The "./staticwebassets" folder should contain all generated static web assets and all static web assets which have been placed under the "./wwwroot" folder in the project.

Observed Behavior

The "./staticwebassets" folder is not created within the package. Scoped CSS and collocated JavaScript are not included in the package. Files under "./wwwroot" are included as contentFiles.

Removing the dependency to nugetizer and running dotnet pack gives the expected behavior.

Is there a workaround for this without having to remove the dependency to nugetizer?

Back this issue
Back this issue

@NormanM123 NormanM123 added the bug Something isn't working label Aug 3, 2024
@kzu kzu added enhancement New feature or request help wanted Extra attention is needed and removed bug Something isn't working labels Aug 7, 2024
@kzu
Copy link
Member

kzu commented Aug 7, 2024

I did an initial investigation. This requires adding specific support for static web assets SDK in nugetizer.

Please consider sponsoring this development. Otherwise it's low priority for me personally.

Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants