How to deploy reusable .scss files using nuget in .NET Blazor project instead of npm while can be referenced within project folder? #13201
Unanswered
aDisplayName
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In Angular Project, the reusable SCSS is being deployed via node modules using npm. But for C# Blazor project, we would like to see the similar solution by using nuget.
In our case, we have created a
common-color.scss
file to provide a common color code definitions.Project: SharedColor.csproj / Styles / common-color.scss
What we would like to achieve, is to package this
common-color.scss
into theSharedColor.nupkg
as source code, and allow the project importing this nuget package to be able to reuse the file with their own .scss files:Project: BlazorApp1.csproj / Page / index.razor.scss
We are using AspNetCore.SassCompiler to convert
index.razor.scss
intoindex.razor.css
during the build.When building project, as shown below, An error was thrown because the build task Compile Sass from AspNetCore.SassCompiler could not find file
/Styles/common-colors.scss
under the project folderBlazorApp1
at the time the task was performed, as we can see the file is actually located under%USERPROFILE%\.nuget\packages\sharedcolor\1.0.0\contentFiles\any\net8.0\Styles\common-colors.scss
My question is
Is there a term/name for those items "virtually showed up" from nuget package into the host project's 'virtual folder'?
import
oruse
statement? It would be useful to compile front-end artifacts without rely on NPM.Regards
The code example can be found at here
Beta Was this translation helpful? Give feedback.
All reactions