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: 1 comment 4 replies
-
|
@jeffkl I've been trying to solve this on off for about two years now with no prevail. Is it possible to get your insights on this ? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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.scssfile 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.scssinto theSharedColor.nupkgas 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.scssintoindex.razor.cssduring 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.scssunder the project folderBlazorApp1at 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.scssMy question is
Is there a term/name for those items "virtually showed up" from nuget package into the host project's 'virtual folder'?
importorusestatement? 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