Skip to content

Not seeing bundling happening from Razor Class Library consumption? #20931

@taylorchasewhite

Description

@taylorchasewhite

If other projects are utilized, such as NuGet packages or Razor class libraries, the bundled file:

References the styles using CSS imports.
Isn't published as a static web asset of the app that consumes the styles.

I'm not able to get this to work, but maybe I'm doing something wrong or not interpreting these comments correctly.

From my understanding, I have a Razor Class Library/NuGet Package, BlazingApple.Survey, and I want to add CSS isolation to one of the components.
Instructions are as follows for the developer of the NuGet package or class library:

  1. Create the CSS isolation file (same name, ComponentName.razor.css).
  2. Build Razor Class Library solution, which are referenced by a consuming client project, where this will automatically be picked up.

Instructions for the consuming project to pickup the CSS isolation associated with an RCL component:

  1. In the consuming project, BlazorConsumer2.Client we reference a stylesheet BlazorConsumer2.Client.styles.css, which should have the sum total of all of the CSS from our referenced NuGet packages/RCLs, right?

I don't see that happening. Is there something that the NuGet package/RCL needs to do in order to have it's CSS consumed in the project using it? When I look at the bundled CSS file in the consuming project, none of the styles have been added to that stylesheet.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions