-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Description
Reference:
1.) How to include bootstrap or other css library files in .bundle.scp.css
This documentation says:
To include companion assets as part of an RCL, create a wwwroot folder in the class library and include any required files in that folder.
When packing an RCL, all companion assets in the wwwroot folder are automatically included in the package.
Use the dotnet pack command rather than the NuGet.exe version nuget pack.
In my case the css in wwwroot is not not included in the bundle file. To reference wwwroot css in my project I have to the second link shown below in the consuming project:
<link href="_content/MyComponent/MyComponent.bundle.scp.css" rel="stylesheet" />
<link href="_content/MyComponent/css/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
In the file produced in obj/debug/net5.0/scopedcss/projectbundle/MyComponent/MyComponent.bundle.scp.css there is no reference to the wwwroot files. Here is the exact content:
@import '';
/* _content/MyComponent/MyComponent.razor.rz.scp.css */
.my-container[b-sd16mhok0g] {
display: flex;
flex: 1 1 0; }
I tried using dotnet pack
as indicated in the documentation and referencing the nuget in the host project. It makes no difference. Currently I am referencing the RCL as a project so I can develop using dotnet run watch
. Is this supported?
2.) How to isolate wwwroot level css libraries in RCL projects
This may be answered by #1 above however I want to ask specifically. My host project uses an older version of bootstrap and those styles are affecting my control.